Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3 ( 50 points). The quadratic formula can be used to determine the roots of a quadratic equation r=(-b+-sqrt(b^(2)-4ac))/(2a) Write a script that

Problem 3 ( 50 points). The quadratic formula can be used to determine the roots of a quadratic equation\

r=(-b+-\\\\sqrt(b^(2)-4ac))/(2a)

\ Write a script that defines values for variables

a,b

, and

c

and evaluates the root(s) of the quadratic,

r

.\ Your script must do the following:\ a. Ensure the variables

a,b

, and

c

are of either type int or float. No exceptions should be raised (meaning the code still fully runs) by trying to do math on e.g. strings, but a warning should be printed for the user.\ b. Print the root(s) indicating if the roots are real or complex and if there is one or two unique roots. An example output might look like:\ "This quadratic has one real root which is 10 ."\ The output string must be accurate for ANY possible inputs of

a,b

, and

c

.\ Hint: make use of the typeO function.

image text in transcribed
Problem 3 ( 50 points). The quadratic formula can be used to determine the roots of a quadratic equation. r=2abb24ac Write a script that defines values for variables a,b, and c and evaluates the root(s) of the quadratic, r. Your script must do the following: a. Ensure the variables a,b, and c are of either type int or float. No exceptions should be raised (meaning the code still fully runs) by trying to do math on e.g. strings, but a warning should be printed for the user. b. Print the root(s) indicating if the roots are real or complex and if there is one or two unique roots. An example output might look like: "This quadratic has one real root which is 10 ." The output string must be accurate for ANY possible inputs of a,b, and c. Hint: make use of the typeO function

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

Get Funded The Startup Entrepreneurs Guide To Seriously Successful Fundraising

Authors: John Biggs, Eric Villines

1st Edition

1260459063, 978-1260459067

Students also viewed these Databases questions