I am having trouble understanding this website for a college class
the teacher wants us to make a program to convert feet into yards.
can someone teach me or help me how to understand how to do that??
thank you!!!
Sure! What language?
Problem: You are asked to write a program to receive a length expressed in feet, convert it to
yards, and show the result on the screen.
The formula for converting a length expressed in feet to yards is:
length in yards = 1/3 x length in feet
Your solution must ask the user to enter the length in feet at the keyboard and then calculate and display the resulting length in yards. You must ask for and display the first name of the person using your program too.
------------------------------------------------------------------------------------------------------------------------ Your task: implement in C++ the algorithm solution shown below. ------------------------------------------------------------------------------------------------------------------------
Algorithm solution (in pseudocode):
To solve this problem your program must perform the following tasks:
Declare a variable named user_name that holds text.
Declare variables named length_feet and length_yards that hold single precision real numbers. Prompt the user to enter his/her first name.
Get the name and store it in the corresponding variable.
Prompt the user to enter the length in feet.
Get the length from the keyboard and store it in the corresponding variable.
Calculate the length in yards using the formula exactly as provided above and assign the result to the corresponding variable.
Display on the screen the following message:
“Hi,” user_name
length_feet, " feet are equal to ", length_yards, " yards"
The program must compile without errors or warnings. Try to work on it before the lab so you can discuss with your teammate your solutions in order to submit the best of both them.
I am posting the executable of my solution for your reference. Please run it and ensure that your program works like mine. Try the values 9, 9.6, 10, 11, 11.25, and 12.25. Is there anything that gets your attention? Run my program and yours using the same input data and compare the results to see if they match. The input and output formatting must be similar to the one used in my sample [email protected]
alright @CeciliaLeal
So, from what I understand:
working repl
but what do I put or how do I used I am so confused and I love math and I still don't understand it
@Coder100
wdym what part is confusing? We get the input and then divide that by 3 because there are 3 feet in a yard. @CeciliaLeal
oh okay I understand it know thank you!! @Coder100
no problem!! Please mark as correct answer! @CeciliaLeal