soccer909 0 Newbie Poster

I am writing a program.
In the program, I have to compact as many songs with total time under 80 minutes into a CD.
I have to also have the program output the total time remaining on each CD. AND I have to have the program output the total time of songs between the CDs. (the example from the teacher is for 2 CDS).

This is what I have so far. If someone could please help me ASAP. Thanks. :

#include <iostream>
#include <iomanip>
using namespace std;

const int MAX_MINUTES = 80;
const int MIN_MINUTES = 1;
const int MAX_SECONDS = 59;
const int MIN_SECONDS = 1;
const int SECONDSPERMINUTE = 60;



int main ()
{
   int cdnum = 0;
   int songnum;
   int minutes;
   int seconds;
   int minute;
   int second;
   int songtime;
   int totaltime;
   int totalseconds;
   int totalminutes;
   int counter = 1;

   cin >> songnum;

   while ( !cin.eof() )
   { 
       cdnum ++;
       cout << "Times for CD # " << cdnum << endl;
       cout << "Song" << setw(25) << "Song Time"
            << setw(31) << "Total Time" << endl;
       cout << "Number" << setw(15) << "Minutes"
            << setw(15) << "Seconds" << setw(15)
            << "Minutes"<< setw(15)
            << "Seconds" << endl;
       cout << "------" << setw(15) << "-------"
            << setw(15) << "-------"
            << setw(15) << "-------"
            << setw(15) << "-------" << endl;                

      while ( counter <= songnum )
      {
      cin >> minutes;
      cin >> seconds;
      counter ++;
      }     
       cin >> songnum;
   }
return 0; 
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.