Hi I'm a green grasshopper with programming. :( Just started a class this fall semester and I'm just having trouble. I'd like to think I pick up on things fast but I don't know anymore.
Anyway my question is about getting my columns to align properly as I don't know why they are some are off to the right too far all of the sudden, etc.
This assignment I have is from a previous assignment where we have to make an exercise calculator.
I am also having trouble getting the code right for calculating hours. It's supposed to be calculated like this.
Calculate the total amount of time spent working out in hours and minutes. This can be done by adding up the minutes spent in each activity and using the / and % operators to calculate the quotient and remainder produced by dividing this number by 60.
But I don't really get how to formulate that.
cout << "Here are the results for " << name << ":" << endl;
cout << "-----------------------------------------" << endl;
cout << "Activity" << left << setw(10) << right << "Time" << setw(15) << right << "Calories" << setw(20) << endl;
cout << "Badminton " << left << setw(10) << TTLCALBADMINTON << right << setw(20)<< endl;
cout << "Running " << left << setw(10) << TTLCALRUNNING << right << setw(20) << endl;
cout << "Walking " << left << setw(10) << TTLCALWALKING << right << setw(20) << endl;
cout << "Weights " << left << setw(10) << TTLCALWEIGHTS << right << setw(20) << endl;
cout << "-----------------------------------------" << endl;
cout << "Totals " << left << setw(10) << endl;
system("PAUSE");
return 0;
}
In the time column it's supposed to be the hours calculated but I haven't figured that out yet.
Thanks in advance for any help. I'm not really looking for an answer just how to arrive there and what I'm doing wrong. My program compiles just fine just my columns look messy.
Strange. When I put my example of how my columns are supposed to look. It looks crappy. I'm sorry about that. But basically they're all supposed to align to each column :/