Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++ For part 4, use equations d + j e where d is real part and e is imaginary part a ( d +je)(

image text in transcribed

image text in transcribed

Using C++

For part 4, use equations d + j e

where d is real part and e is imaginary part

a ( d +je)( d + je) + b (d + j e ) + c = 0

a ( d^2 + 2jde - e^2) + (bd + jbe) + c = 0

j^2 = -1

Need help with this one. Thank you!

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 th en 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) x 2-x 12 Note the following: if a is 1 then print x2 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 +-1 x 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) (2-repeated roots) (3-complex roots): 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, -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 20.0701 Solution is acceptable for root 2 4) If root type is 2 then ask the user for the repeated root. Evaluate the quadratic equation for the given root. Print proper message to indicate how close the evaluation is to 0. Here a-1, b-5, c4. Enter repeated root: 2 root 12 root 22 Solution for repeated root 2 Solution is not acceptable for the repeated root 4) If root_type is 3 then ask the user for the complex roots. Evaluate the quadratic equation for the given roots. Print proper message to indicate how close the evaluation is to 0. Here a-2, b-3 c-4. Equations will be given in the class on how to evaluate the complex roots. Enter real part of root 1: -0.75 Enter imaginary part of root 1: 1.199 root 1 -0.75 j1.199 root 2-0.75 1.199 Solution for root 1-0.000202 Solution is acceptable for root 1 Solution for root 2 0.000202 Solution is acceptable for root2 if imaginary part is negative such as -1.199 then print j1.199 instead of+ j-1.199

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

Recommended Textbook for

Oracle Database Upgrade Migration And Transformation Tips And Techniques

Authors: Edward Whalen ,Jim Czuprynski

1st Edition

0071846050, 978-0071846059

More Books

Students also viewed these Databases questions