bers to the screen AND to an output file. Instructions For this assignment, imagine you are burning some music CDs for a party. You have arranged a list of songs in the order you want to play them. However, you would like to maximize your use of space on the CD, which holds 80 minutes of music. To do so, you want to figure out the total time for a group of songs and see how well they fit. Write and design a C++ program to help you accomplish this task. The number of seconds for each song is already provided for you below: 310

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

Programming: While Loops Assignment Instructions

Overview

You will read data from a text file using a control loop, convert the numbers to the proper format, and then send the numbers to the screen AND to an output file.

Instructions

For this assignment, imagine you are burning some music CDs for a party. You have arranged a list of songs in the order you want to play them. However, you would like to maximize your use of space on the CD, which holds 80 minutes of music. To do so, you want to figure out the total time for a group of songs and see how well they fit. Write and design a C++ program to help you accomplish this task. The number of seconds for each song is already provided for you below:

310

462

627

273

300

535

259

625

736

122

215

Save this table in a separate data file and name it “songs.txt” Save it in the same folder as your program file. The time is entered as seconds. For example, if a song takes 7 minutes and 42 seconds to play, the data entered for that song would be 462.

Create a program that

  1. Reads the data from the song.txt file
  2. Calculates the minutes & seconds for each song.
  3. Prints the list of songs, the amount of time it consumes, the total amount of time on the CD, and the amount of time remaining available on the CD.
  4. Prints the output   in the form of a table with columns and headings written on a file. For example:

Note: The output converts the input from seconds to minutes and seconds. Use meaningful variable names, proper indentation, and appropriate comments. Thoroughly test the program using your own data sets.

  1. Make the program aesthetically appealing for the user and for a fellow programmer

Use meaningful variable names, proper indentation, and appropriate comments. Thoroughly test the program using the data set found in songs.txt file provided for you.

Template

//<File name> -- brief statement as to the file’s purpose

//CSIS 111-<Section Number> ADD YOUR SECTION NUMBER

//<Sources if necessary>

 

//Include statements #include <iostream> #include <string> using namespace std;

 

//Global declarations: Constants and type definitions only -- no variables

//Function prototypes int main()

{

//In cout statement below SUBSTITUTE your name and lab number

cout << "Your name -- Lab Number" << endl << endl;

 

//Variable declarations

 

//Program logic

 

//Closing program statements system("pause");

return 0;

}

//Function definitions

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning