Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a program using C++ please also provide screenshots of the output. output needs be like shown in the picture. thank you!! J aild lnatH

image text in transcribed

write a program using C++ please also provide screenshots of the output. output needs be like shown in the picture.

thank you!!

J aild lnatH HHithmetic functions Write a program that asks for and accepts three doubles: a, b and c from the second order equation ax + bx + c = 0, The program will ask for the roots and evaluate the equation. If the evaluation is 0 then you print the solution is perfect, if the evaluation is less than 0.1 then print the solution is acceptable otherwise print the solution is not acceptable. Write a program that does the following: 1) Read coefficients of second order polynomial and print equation to the screen. Enter a: 1 Enter b: 1 Enter c: -12 f (x)-x2 12 Note the following: if a is 1 then print x 2 instead of 1x*2 if a is-1 then print-x 2 instead of-1x 2 if b is 1 then print+ x instead of+ 1x if b is-1 then print - x instead of +-1x if b is negative such as -2.34 then print 2.34x instead of + -2.34x if c is negative such as-1.98 then print 1.98 instead of + -1.98 2) Declare variable root type as an integer. Use the following prompt to ask the user for the root type. Print to the screen as below. Enter root type (1-distinet roots) 12-repeated rootsl 13 complex roats): 1 root type - 1 3) If root_type is 1 then ask the user for two roots. Evaluate the quadratic equation for the given roots. Print proper message to indicate how close the evaluation is to 0. Here a-1, b--1, c--12. Enter root 1: 4 Enter root 2: -3.01 root 1-4 root 23.01 Solution for root 1-0 Solution is perfect for root 1 Solution for root 2 0.0701 Solution is acceptable for root 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions