Question: C++ program to do the following :Modify the pace calculator program to accept input from the keyboard for hours, minutes, seconds, race name, city, state,

C++ program to do the following :Modify the pace calculator program to accept input from the keyboard for hours, minutes, seconds, race name, city, state, and date.

Print all the information above along with the pace and MPH to a txt file for append, along with printing to the screen.

Make sure to submit the txt file also.

Run the program twice with the following data:

13.1 miles, 2 hours, 36 minutes, and 6 seconds, Swinging Bridge Run, Tishomingo MS, April 21, 2018

3.12 miles, 0 hours, 25 minutes, 58 seconds, Run for the Cure, Moulton Al April 14, 2018

Submit your file, output to the screen, and the source code.

I would get the program working to the screen, and then add the lines to print to a file.

You don't need a for loop since you will run the program once for each set of data.

You can test your data at: http://www.coolrunning.com/engine/4/4_1/96.shtml

Speed Calculatro: https://www.omnicalculator.com/other/speed

The pace calculator program is below:

#include //to use cout and cin and endl// allows using cout without std::cout

#include // to use string data type

#include //to use strlen, strcmp, strcpy

#include //for pow function,sqrt,abs

#include // for set precision, setw,

#include //for file input

#include // to use assert to disable place before #define NDEBUG

#include //for random numbers, exit function

#include //time function used for rand seed

#include // for toupper, tolower

#include

#include

#include

using namespace std;

namespace studentnames

{ enum studentnames

{ kenny=5,

kyle,

stan

};

}

using namespace studentnames;

int main(int argc, char** argv) {

int hours =0;

int minutes =36;

int seconds = 0;

double miles =2;

int totalseconds = hours*60*60+minutes*60+seconds;

double secondspermile=totalseconds/miles;

double paceminutes=secondspermile/60;

double paceseconds=(int)secondspermile%60;

cout<<(int)paceminutes<<"|"<

double mph = miles/((hours+((double)minutes/60))+(double)seconds/3600);

cout<

//enums

enum color

{

red,

yellow,

green=20,

blue,

Red

};

color mycolor=red;

if(mycolor==red)

{

cout<

}

int myarray[20]={0};

myarray[kenny]=100;

cout<

color r=red;

switch(r)

{case red:

cout<<"red ";

break;

}

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!