Question: C++ this one requires for the numbers to be solved using the quadratic equation. Please help: 1. Quadratic Equations The solution(s) to a quadratic equation

C++ this one requires for the numbers to be solved using the quadratic equation. Please help:

C++ this one requires for the numbers to be solved using the

1. Quadratic Equations The solution(s) to a quadratic equation can be calculated using the Quadratic Formula: Program Requirements: Write a program that prompts the user to enter values for a,b, and c and display the results of two roots. Your program should define at least two functions, one for input and one for calculating the roots. Use the following function prototypes. // Return 1 if real roots exist. Otherwise, return 0. int quadratic(double a, double b, double c, double\& r1, double\& r2); quadratic function computes the two roots. The function has five parameters. The first three parameters are call-by-value parameters, and the last two are call-by-reference parameters. It returns 1 if real roots exist, otherwise return 0.r1 and r2 will return two real roots to the calling functions. void getInput(double\& a, double \&b, double\& c); //read three values and return back to the calling function Sample Output: Lab 8 Programming Exercise 1 by John Smith Quadratic Equation Program Please enter value for a: 3.5 Please enter value for b:1.0 Please enter value for c: 1.0 The equation has complex roots. Would you like to compute another quadratic equation? Y Please enter value for a: 2.0 Please enter value for b: 4.2 Please enter value for c:1.5 The two roots are -0.456283 and -1.64372 Would you like to compute another quadratic equation? N

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!