First Time Using C++ ( High School Student)

Pages: 12
He probably wants the same output..Anyways you signed up for the class so that was pretty much saying you knew enough to pass. It is a introduction class anyways so it shouldn't be any harder than high school.

As for your program what output are you getting? You should try and get 100% output as your teacher.
This is my current Ouput. What baffles me is that I cant have 16 minutes as Minutes. Only between 1 - 10 minutes. I had email my instructor.
  
 Song                    Song Song                 Total Total
   Number             Minutes   Seconds           Minutes   Seconds
  -------             -------   -------           -------   -------
      1                 5        10                 5        10
      2                 8         2                13        12
      3                10         1                23        13
      4                 4        19                27        32
      5                16        23                43        55
      6                 4        33                48        28
      7                 9        27                57        55
      8                 0       -12                57        43
      9                 8        55                66        38
     10                 0        45                67        23
     11                 5         0                72        23
     There are 7 minutes and 37 seconds of space left on the 80minute CD.

Why is the 8th track negative twelve seconds long?
Last edited on
Thank You L B. I did not catch that
I mentioned that earlier....
Can it possible be that my calculation may need to be adjusted?
I haven't read everything, but there some of what I've seen so far is bothering me. I think that you could use a summer to keep track of the total seconds rather than two summers to keep track of minutes and seconds. You only need two variables for the cumulative time and the present time. If the time is less than 0 seconds, then it is probably incorrect input, so it should be ignored.

My suggestion
1
2
3
4
5
6
7
8
9
int cumulative = 0;
int current = 0;

cumulative = //input for new song
current += cumulative;

//display
cout << current / 60 << current % 60;
cout << cumulative / 60 << cumulative % 60;


Obviously you'll need to edit that to get input and display output correctly, but you are using fewer variables and you don't have to worry about rounding corners at the minute because you're only using seconds.
Thank you all for taking the time to help me. I would like to get that perfect score of 60/ 60 but I am going to submit my Assignment as is midnight, because I have another c++ assignment that is due tonight along with my take home midterm of abstract algebra and finite mathematics.
thank you all .
Topic archived. No new replies allowed.
Pages: 12