Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Distance, Speed, and Time You are tasked with creating a program for new students at your university. The program will assist the students with arriving

Distance, Speed, and Time You are tasked with creating a program for new students at your university. The program will assist the students with arriving on time to class. The program will calculate distance, average speed, time in hours or minutes for any trip.
Requirements The program must use user-defined methods. These five methods are required, you can choose to have more 1. Method for calculating the distance 2. Method for calculating the average speed 3. Method for calculating time with result in hours 4. Method for calculating time with result in minutes 5. Method for printing the output of the result, only one method to be used All user inputs must be done in method main You may create an additional method for printing the menu, but it is not required. The options menu must be printed before each selection This statement Thank for using the average speed program! doesnt need to be in printing method
Formula and Units The formula to calculate average speed is speed = distance / time The user must enter distance in miles The user must enter time in hours, where 0.25 hours is equal to 15 minutes The user must enter speed in miles/hour To determine time in minutes instead of hours, multiply the result by 60
Input: Your program should prompt the user to make a selection from the options menu: o Please select an option from the menu: For Menu option 1, the user will be prompted for these inputs o Please enter the speed used for the travel in miles/hour: o Please enter the time traversed for the travel in hours: For Menu option 2, the user will be prompted for these inputs o Please enter the distance traveled in miles: o Please enter the time traversed for the travel in hours: For Menu option 3, the user will be prompted for these inputs o Please enter the distance traveled in miles: o Please enter the speed used for the travel in miles/hour: For Menu option 4, the user will be prompted for these inputs o Please enter the distance traveled in miles: o Please enter the speed used for the travel in miles/hour: For Menu option 5, there is no prompt
2 Output: The options menu o <<<<<>>>>>: o 1. Determine Distance (in miles) o 2. Determine Average Speed (in miles/hour) o 3. Determine Time (in hours) o 4. Determine Time (in minutes) o 5. Exit Menu Menu option 1 o The distance traveled is: (value)miles Menu option 2 o The speed used to travel is: (value)miles/hour Menu option 3 o The time traversed for the travel is: (value)hours Menu option 4 o The time traversed for the travel is: (value)minutes Menu option 5 o Thank for using the average speed program!
please includ call method and variables needed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 27th International Conference Dasfaa 2022 Virtual Event April 11 14 2022 Proceedings Part 2 Lncs 13246

Authors: Arnab Bhattacharya ,Janice Lee Mong Li ,Divyakant Agrawal ,P. Krishna Reddy ,Mukesh Mohania ,Anirban Mondal ,Vikram Goyal ,Rage Uday Kiran

1st Edition

3031001257, 978-3031001253

More Books

Students also viewed these Databases questions

Question

What is paper chromatography?

Answered: 1 week ago

Question

Explain the cost of capital.

Answered: 1 week ago

Question

Define capital structure.

Answered: 1 week ago

Question

My opinions/suggestions are valued.

Answered: 1 week ago