Write a quadratic calculator in C++ for the expression: a x + bx+c=0 1. Declare variables...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a quadratic calculator in C++ for the expression: a x + bx+c=0 1. Declare variables a, b, c. Choose arbitrary values for these variable. Make sure that a is not zero and that the expresion inside the root is positive or zero to avoid working with imaginary numbers. 2. Find the two roots: x1 and x2 using the usual quadratic formula: -b62-4ac x = 29 3. As an example, if a=1, b=2, and c=1, you must display the result using the following form with each number showing 2 fractional digits: 1 x2.00 +2.00 x + 1.00 (x -1.00) (x -1.00) Note that because the roots in this example are negative (-1 and -1), the resulting factorization shows double negative signs. This is fine for the purposes of this assignment. 5. Find the maximum/minimum point using the formula: b 62 2a 4a display the result using that format (with parenthesis as shown above) and also with each number showing 2 fractional digits. 6. You must add comments to the code. The evaluation rubric includes: logic and code correctness, formatting (proper use of vertical alignment of C++ code), and explanation of steps (comments). Write a quadratic calculator in C++ for the expression: a x + bx+c=0 1. Declare variables a, b, c. Choose arbitrary values for these variable. Make sure that a is not zero and that the expresion inside the root is positive or zero to avoid working with imaginary numbers. 2. Find the two roots: x1 and x2 using the usual quadratic formula: -b62-4ac x = 29 3. As an example, if a=1, b=2, and c=1, you must display the result using the following form with each number showing 2 fractional digits: 1 x2.00 +2.00 x + 1.00 (x -1.00) (x -1.00) Note that because the roots in this example are negative (-1 and -1), the resulting factorization shows double negative signs. This is fine for the purposes of this assignment. 5. Find the maximum/minimum point using the formula: b 62 2a 4a display the result using that format (with parenthesis as shown above) and also with each number showing 2 fractional digits. 6. You must add comments to the code. The evaluation rubric includes: logic and code correctness, formatting (proper use of vertical alignment of C++ code), and explanation of steps (comments).
Expert Answer:
Related Book For
Applied Regression Analysis and Other Multivariable Methods
ISBN: 978-1285051086
5th edition
Authors: David G. Kleinbaum, Lawrence L. Kupper, Azhar Nizam, Eli S. Rosenberg
Posted Date:
Students also viewed these programming questions
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
Jake's office building is destroyed by a fire on September 15, 2022. Jake receives insurance proceeds on April 15, 2023 in the amount of $300,000. Jake's adjusted basis in the building was $250,000....
-
A government researcher is analyzing the relationship between retail sales and the gross national product (GNP). He also wonders whether there are significant differences in retail sales related to...
-
The potential (relative to a point at infinity) midway between two charges of equal magnitude and opposite sign is zero. Is it possible to bring a test charge from infinity to this midpoint in such a...
-
A university pumps its water from wells located on campus. The falling water table has caused pumping costs to increase, the quantity of water available to decrease, and the quality of water to...
-
Pratt Agriculture sells approximately 600,000 bushels of grain each month. On January 1, 2011, Pratt purchased an option to sell 600,000 bushels of grain on January 1, 2013, at a price of $1.25 per...
-
3. 1. Find the volume of the figures below. 2. Answer: Answer: 8.5 ft 4 ft. 2.5 ft. 7 cm. 14 cm. 6 cm. 4. 12 in 4 in. Answer: 9 in. Juice Answer: 6.5 in. 3 in. 2.5 in. 5 in.. 3 in.
-
(a) (5 points) What is the minimum and maximum number of padding bits that can be added to a message? (b) (5 points) In SHA-512, show the value of the length field in hexadecimal for the following...
-
Take a look at the C code (fa-pipe.c) shown below. Assume that all system and library calls succeed at runtime. (All error handling code has been omitted for brevity.) #include #include #include...
-
What are types of business disasters and why is disaster recovery important. In your example: What business disaster occurred? What was the impact of the business disaster? Did the company have a...
-
Justify why the taxonomies of behavioral concepts for managers and leaders differ.
-
A comparative income statement is given below for McKenzie Sales, Ltd., of Toronto: McKenzie Sales, Ltd. Comparative Income Statement This Year Last Year Sales $ 7,300,000 $ 5,548,000 Cost of goods...
-
1. Draft a thorough essay on "Consuming Food for Religion, Exploring Different Diets of Various Religions". a. Could you please assist me with writing an abstract for the paper "Consuming Food for...
-
The solubility of MgSO4 is 1.16 g/100.0 mL of ether (CzHs)20 at 18C. If you have 0.5 g of salt dissolved in 15.25 mL of ether, do you have a saturated, unsaturated or supersaturated solution? (dether...
-
A Firm intends to invest some capital for a period of 15 years; the Firm's Management considers three Options, each consisting of purchasing a machinery of a specific brand, different for each...
-
The manager of a market research company conducted an experiment to investigate the productivity of three employees on each of two computerized data-entry systems. The employees conducted phone...
-
A study by Holder, Plikaytis, and Carlone (1996) compared two laboratory protocols designed to measure antibody levels in an enzyme-linked immunosorbent assay (ELISA) for Streptococcus pneumoniae....
-
For the data of Problem 14, suppose that a test of H0: 1 = 2 versus HA: > 2 yielded a computed value of the appropriate test statistic equal to 2.55. a. What conclusions should be drawn for = .05?...
-
If price moves from disequilibrium to equilibrium, what happens to the combination of producer and consumer surplus in the market?
-
Why does nearly every purchase you make provide you with consumer surplus?
-
The chapter frames the issue of the effects of taxation in terms of its effects on producer and consumer surplus. a. What does that framework leave out of the analysis? b. How might one frame the...
Study smarter with the SolutionInn App