In: Computer Science
Programming can be used to assist users in completing
complex calculations very quickly. As seen in class practices, we
were able to calculate the area of geometric shapes, figure out the
amount of calories in cookies, and even calculate a restaurant
bill.
For this assignment, you will take input from the user to provide
interactive messages and to solve the following word problem:
Engineers often need to convert between different types of units to
perform calculations that follow standard formulas. One conversion
that is very common involves converting distances. List the steps,
by writing pseudocode, that explains how you would ask the user to
provide the distance in miles and would display: 1) The distance in
kilometers, 2) the distance in feet, 3) the distance in
yards.
Example:
The program asks the user to provide their name and displays a
greeting message that explains its purpose. The program requests
the distance in miles. The user provides the number 158 for miles.
The program calculates and displays the results of: 1) 254.28
kilometers, 2) 834240 feet, 3) 278080 yards
Your Task:
For now, we are not going to do any programming! You must
understand that you should plan your code. Planning your code saves
you time in the long run and allows you to use the solution in any
programming language.
For this part of your project, you must write pseudocode explaining
the steps that you will take to create the program described
above.
Remember that pseudocodes involve absolutely no Python yet.
Remember that in a PSEUDOCODE we should identify the: 1) Input, 2)
Process, 3) Output
using pseudocode and give me the process and programming
First of all lets try to understand the steps that are involved here:
step 1: Display a message to user asking the to provide their name and then Get the input of their name.
step 2: Display a greeting message with user's name along with description about the program and its purpose. And also ask then to enter the distance in Miles.
step 3: Get the input from the user and store it in a variable and then calculate distance in other units using below conversion factors:
After calculating these values,
step 4: Display or print the values in required form i.e., 1) KM kilometers 2) FEET feets 3) YARDS yards
Now, the pseudocode would be as follow:(#note that MILES, KM,FEET and YARDS are variables of float or decimal type.)
if still having any doubt feel free to ask in comments.
Don't forget a thumbs up,
thank you.