Question: You will write a program that converts yards to centimeters. The formula for converting yards to centimeters is to multiply yards by a factor of

You will write a program that converts yards to centimeters. The formula for converting yards to centimeters is to multiply yards by a factor of 91.4.
Here are the program requirements.
The main() method displays the following information for the user to read:
This program converts yards to centimeters. The formula for converting yards to centimeters
requires that you multiply yards by a factor of 91.4
Within the main() method, the user is prompted to enter yards and yards is accepted as input.
After accepting yards as input, call a yardsToCentimeters() value returning function that will take the yards input from the main() method into the yardsToCentimeters() function. Then it will convert the yards to centimeters by multiplying yards by a factor of 91.4 and return the centimeters to the main() method. Obviously, you must code the yardsToCentimeters() function.
Within the main method, display a statement that shows the number of yards input and the value in centimeters that it was converted to. Then end the main() method.
Here are some reminders:
You are not allowed to use any global variables or constants in your solution.
You must declare all variables as the correct data type where needed.
You must figure out which argument(s) must be passed from the main() method to the yardsToCentimeters() function as parameter(s) for the function to correctly convert yards to centimeters.
You must indent your code correctly.
You must code the yardsToCentimeters() functions.
To better your understanding of how the program should work, here is an example of how the code should run. User input is shown in red, bolded, and italicized.
This program converts yards to centimeters.
The formula for converting yards to centimeters
requires that you multiply yards by a factor of 91.4
Enter the number of yards:
2
2 yard(s) converts to 182.8 centimeters.

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 Programming Questions!