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
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
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 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 arguments must be passed from the main method to the yardsToCentimeters function as parameters 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
Enter the number of yards:
yards converts to centimeters.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
