Reference no: EM1369606
Write a code using C++ that takes input from the console and displays output on the console. You will write a program that takes user input, does some basic arithmetic, and displays the results.
The program should prompt the user for the number of seconds and the number of miles traveled. The program should convert the given number of seconds into different units of time and using the given total distance should report the average speed. The output should give the time in years/days/hours/minutes/seconds and the average speed in both miles per hour (mph) and feet per second (ft/s). You should use the conversions:
* 1 mile = 5,280 feet
* 1 year = 365 days
* 1 day = 24 hours
* 1 hour = 60 minutes
* 1 minute = 60 seconds
Sample output should be something like the text below, where the user entered 123456 seconds and 42 miles:
Enter the total time of the journey (in seconds): 123456
Enter the total distance traveled (in miles): 42
You have been travelling for 0 years, 1 days, 10 hours, 17 minutes, and 36 seconds.
Your average speed is 1.225 mph or 1.796 ft/s.
The only difference could be the number of decimal places you report. You may assume all time units are plural, so it's OK to say "1 days" or "1 years" as above. You are only allowed to use the material we've learned so far, so you are not allowed to use any if statements or loops.
Comments: As with all programs in this course, your code should contain useful comments. In particular, your name and a brief description of what the program does should appear at the top of your source file. Here is an example template, which you can use in your assignment:
What appears to be major constraint that central banks used
: What appears to be major constraint that central banks used to determine limits of monetary injections into economy. Did United States use same or different criteria.
|
Description of review
: How would a degree in international relations assist me in furthering my career objectives as well as advances my understanding of the global geo-political landscape when running such a global corporations in multi continent.
|
Explain key multinational and local players
: Explain Key multinational and local players in the target industry in the target country. Please provide detail information.
|
Show the welfare reform
: What is welfare reform? Lawmakers in many states are trying to pass welfare reform orders to decrease women having children and people needing assistance.
|
Write code to takes input from console
: Write code using C++ which takes input from console and displays output on console. You will write program which takes user input, does some basic arithmetic, and displays the results.
|
What is maximum amount it would be worth to shareholders
: What is maximum amount it would be worth to shareholders to elicit high CEO effort all time rather low CEO effort all time.
|
Provide example of the prisoner dilemma
: Nintendo and Sony Playstation are each considering to introduce one new game into the market. Each is planning three different kinds of games: an urban action game like Grand Theft Auto,
|
Explain what is the reliability of a measurement
: Explain what is the reliability of a measurement and what is the validity of a measurement? Can a measurement wbe valid if it is not reliable? Explain.
|
Explain the project you are managing is a small one
: Explain The project you are managing is a small one and Do you think it is necessary to review all of the risks in a Minor Review? Can you just do a sampling of them to see what is happening
|