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
#include
#include
#include
#include
#include
#include
#include
#include
#include
#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
Get step-by-step solutions from verified subject matter experts
