What am I doing wrong??!!! I'm getting BADMINTON, RUNNING, WALKING and TRAINING are undeclared identifiers. This assignment has caused me so much grief for two weeks. I'm extremely confused!!!!
Here is the assignment:
CSCI 1010Programming Assignment 4Expressions and InteractivityLearning OutcomesFormat output so that
oating point numbers have xed precision.Format output so that text aligns properly.Use the string data type andgetlineto read text with spaces in it.Required ReadingGaddis - Chapter 3InstructionsIn your last assignment you wrote a calorie calculator. For this assignment you will rewrite it so it displaysthe results using the output formatting we discussed in class.Here are the changes you must make:Before prompting for the user's weight, it should also prompt them for their name. It should be ableto handle input of a single line containing spaces.The output should be formatted in columns consisting of the activities participated in, the hours andminutes spent on each activity, and the number of calories burned for each activity.In addition the total times and calories should be formatted into columns as well.Time should be displayed inH:MMformat. The tricky part here is dealing with what happens whenthe minutes are less than 10. You can handle this by using thesetfillstream manipulator:cout << setfill('0') << minutes << setfill(' ');This sets the character used to ll whitespace to a0before displaying the minutes, then sets it back toa space afterwards.Calories should be displayed usingxedprecision with exactlythreedigits after the decimal point.The user's name should also be incorporated into the output (see the next section for examples.)1
Example Input and OutputHere is an example run of the program:Please enter your name: Joe CoolPlease enter your weight: 183Please enter the minutes spent playing badminton: 73Please enter the minutes spent running: 64Please enter the minutes spent walking: 99Please enter the minutes spent lifting weights: 33Here are the results for Joe Cool:Activity Time Calories-----------------------------------Badminton 1:13 587.796Running 1:04 1018.944Walking 1:39 652.212Weights 0:33 253.638-----------------------------------Totals 4:29 2512.590Here is another example run:Welcome to Nicholas Coleman's Workout Calculator!Please enter your name: Red BaronPlease enter your weight: 135Please enter the minutes spent playing badminton: 43Please enter the minutes spent running: 62Please enter the minutes spent walking: 14Please enter the minutes spent lifting weights: 2Here are the results for Red Baron:Activity Time Calories-----------------------------------Badminton 0:43 255.420Running 1:02 728.190Walking 0:14 68.040Weights 0:02 11.340-----------------------------------Totals 2:01 1062.990
What are the units for the weight? Pounds, I gather. Reflect that in the prompt and the variable name WeightPounds
The output should be formatted in columns consisting of the activities participated in, the hours and minutes spent on each activity, and the number of calories burned for each activity.In addition the total times and calories should be formatted into columns as well.Time should be displayed inH:MMformat.