Freelancing(Developer & Trainer). Undertaking projects/assignments. Open for short & long term contracts.
⚡ Cpp Program 🔥 Artist album tracks #tecqmate
Get link
Facebook
X
Pinterest
Email
Other Apps
#include<iostream>
#include<fstream>
#include<string>
#include<iomanip>
using namespace std;
int main(){
ifstream in("namedalbuminfo.txt");
if(!in){
cerr << "Failed to load input file!" << endl;
return 1;
}
ofstream out("namedtracklist.txt");
string line;
int hours, mins, sum_hrs = 0, sum_mins = 0, count = 0, diff;
getline(in, line);
out << "Album title: " << line << endl;
getline(in, line);
out << "Artist: " << line << endl;
cout << "Welcome to 's tracklist generator!" << endl;
out << "Tracks:" << endl;
out << "--------------------------------------------------" << endl;
while(!in.eof()){
count ++;
getline(in, line);
in >> hours >> mins;
in.ignore();
out << setfill('0') << setw(2) << count;
out << " - " << line << ' ';
out << hours << ':' << mins << endl;
sum_hrs += hours;
sum_mins += mins;
diff = sum_mins - 60;
if(0 < diff){
sum_hrs ++;
sum_mins = diff;
}
}
out << "--------------------------------------------------" << endl;
in.close();
out.close();
cout << "Processed " << count << " tracks." << endl;
cout << "Total album length: " << sum_hrs << ':' << sum_mins << endl;
cout << "Notes and Comments" << endl;
return 0;
}
Bows + Arrows
The Walkmen
What's in It for Me
2 53
The Rat
4 27
No Christmas While I'm Talking
4 30
Little House of Savages
3 15
My Old Man
4 46
138th Street
3 2
The North Pole
3 48
Hang On, Siobhan
3 45
New Year's Eve
2 20
Thinking of a Dream I Had
4 33
Bows + Arrows
5 16
Introduction: Understanding the fundamental concepts of PHP syntax and variables is essential for beginners. In this detailed blog post, we'll explore PHP syntax and variables in depth, providing you with clear explanations and practical examples to solidify your understanding. Table of Contents: 1. PHP Syntax Overview 2. Writing Your First PHP Script 3. Comments in PHP 4. PHP Variables 5. Variable Naming Conventions 6. Data Types in PHP 7. Assigning Values to Variables 8. Printing and Displaying Variables Let's dive into each section and explore PHP syntax and variables with detailed explanations and examples. 1. PHP Syntax Overview: PHP has a straightforward syntax. We'll cover the opening and closing PHP tags (`<?php` and `?>`), as well as basic structure and formatting guidelines for writing PHP code. 2. Writing Your First PHP Script: We'll walk you through writing your first PHP script step-by-step. You'll learn how to set up a development environment, ...
Introduction: Before you can start coding in PHP, you need to set up the development environment by installing PHP on your machine. In this blog post, we'll walk you through the process of installing PHP on different operating systems, ensuring you have everything you need to begin your PHP programming journey. Table of Contents: 1. Installing PHP on Windows 2. Installing PHP on macOS 3. Installing PHP on Linux 4. Verifying the PHP Installation 5. Configuring PHP Let's dive into each section and learn how to install PHP on your preferred operating system. 1. Installing PHP on Windows: Step-by-step instructions on installing PHP on a Windows machine. We'll cover the installation of XAMPP, a popular PHP development environment that includes Apache, MySQL, and PHP. 2. Installing PHP on macOS: A detailed guide on installing PHP on macOS using Homebrew, a package manager for macOS. We'll walk you through the installation of PHP and configuring Apache. 3. Installing PHP on ...
Comments
Post a Comment