Write a complete C++ program that: 1) Prompts the user to enter from the keyboard two...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 xand 2) Calculates the value of as follows: Shema x² + y² 3) At the beginning of a new line, displays the entered values of randy. Each is located in a field of 9 positions with 2 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 off at the beginning of the next line 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 spaces. You program MUST display the results exactly as shown in the sample runs below. Two sample runs: Enter two numbers of type float please: 12.456 4.897 X = ****12.46 y *****4.90 The result = S 1.771 Enter two numbers of type float please: 3.75 20.79 X = *****3.75 y ****20.79 The result = -1.240 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 xand 2) Calculates the value of as follows: Shema x² + y² 3) At the beginning of a new line, displays the entered values of randy. Each is located in a field of 9 positions with 2 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 off at the beginning of the next line 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 spaces. You program MUST display the results exactly as shown in the sample runs below. Two sample runs: Enter two numbers of type float please: 12.456 4.897 X = ****12.46 y *****4.90 The result = S 1.771 Enter two numbers of type float please: 3.75 20.79 X = *****3.75 y ****20.79 The result = -1.240
Expert Answer:
Answer rating: 100% (QA)
include using namespace std int main Declare two floatingpoint variables float x ... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
Background Facts Young Rodman Young Rodman was born in Australia on 5 August 1985, and has lived in Australia his entire life. Young lives in a large family home with his wife and children. All...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Describe and provide examples of price and quality controls. Price Control is a policy that sets or caps the price of services or the growth in prices directly. It can be used to limit health care...
-
Your organisation requires all new business documents be scanned and saved electronically once they are checked for accuracy. They also require that you update the database system with the new...
-
1. Which radiation induces the most biological damage for a given amount of energy deposited in tissue? (a) Alpha particles. (b) Gamma radiation. (c) Beta radiation. (d) All do the same damage for...
-
An ideal gas, CP = {5f2) R and CV = (3/2) R, is changed from P = 1 bar and v11 = 12 m3 to P2 = 12 bar and v12 = 1 m3 by the following mechanically reversible processes: (a) Isothermal compression (b)...
-
Benchmarking of eco-efficiency indicators faces a number of practical problems. What are these? Can they be overcome? Why is internal benchmarking more common than external benchmarking?
-
Liane Hansen has prepared the following list of statements about bonds. 1. Bonds are a form of interest-bearing notes payable. 2. When seeking long-term financing, an advantage of issuing bonds over...
-
When designing the distribution channel, one of the decisions we must make is deciding the type of distribution channel to use: direct, some variant of an indirect channel, multichannel, omnichannel....
-
Identify by letter the curve you would expect in the titration of a solution containing (a) Disodium maleate, Na 2 M, with standard acid. (b) Pyruvic acid, HP, with standard base. (c) Sodium...
-
If quality is free, why do authorities recognize that an improvement program needs investment?
-
A 0.207 kg particle with an initial velocity of 3.12 m/s is accelerated by a constant force of 3.10 N over a distance of 0.147 m. Use the concept of energy to determine the final velocity of the...
-
When the wavelength for maximum light emission of a scintillator is 450 nm, what is the energy of the light photon?
-
Wardell Company purchased a minicomputer on January 1, 2022, at a cost of $54,000. The computer was depreciated using the straight-line method over an estimated five-year life with an estimated...
-
On April 1, 2024, Antonio purchased appliances from the Acme Appliance Company for $500. In order to increase sales, Acme allows customers to pay in installments and will defer any payments for six...
-
4. Two guns are mounted a distance of 40 Ins (light-nanoseconds) apart on the embankment beside a railroad track. The barrels of the guns project towards the track so that they almost brush a...
-
What is the current yield of a bond with a face value (or part value) of $1,000 and a coupon rate of 6% if the bond is currently selling for $940?
-
In Problems, solve each system of equations. x + 2y + 3z = 5 y + 11z = 21 5y + 9z = 13
-
Define named constants that you could use in Programming Project 6 in Chapter 1. Programming Project 6 Write an JavaFx application that displays the following pattern:
-
Write a fragment of code that will change the integer value stored in x as follows. If x is even, divide x by 2. If x is odd, multiply x by 3 and subtract 1.
-
Add a method bubbleSort to the class ArraySorter, as given in Listing 7.10, that performs a bubble sort of an array. The bubble sort algorithm examines all adjacent pairs of elements in the array...
-
The presence of air in the brake system fluid causes the brake pedal to feel __________________.
-
Three main components of pst brake antiskid systems are __________________, __________________ and a __________________.
-
__________________ pressure bleeding is not an option for power brakes; the air trapped in the brake system would be forced into the main hydraulic system, which should operate without air in the...
Study smarter with the SolutionInn App