Question: Write a complete C++ program that: 1) Prompts the user to enter from the keyboard two numbers of type float and store them in the

Write a complete C++ program that: 1) Prompts the user to enter from the keyboard two numbers of type float and store them in the variables x and y. 2) Calculates the value of f as follows: = ( + ) . 2 + 2 3) At the beginning of a new line, displays the entered values of x and y . Each is located in a field of 10 positions with 3 digits to the right of the point. The unused positions in the fields MUST be filled with #. The values are separated by a tab. 4) Displays the value of f at the beginning of the next line in a field of 12 positions with 4 digits to the right of the point. The unused positions in the fields MUST be filled with spaces. You program MUST display the results exactly as shown in the sample runs below. Two sample runs: Enter two float values please: 2.5 3.75 x= #####2.500 y= #####3.750 The result = ####-22.5347 Enter two float values please: 9.45 12.89 x= #####9.450 y= ####12.890 The result = ###-103.7962

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