Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is my current code^ it needs to be modified to fit the credentials below. 6 import math 7 10 12 13 14 15 16

image text in transcribedThis is my current code^

it needs to be modified to fit the credentials below.

image text in transcribed

6 import math 7 10 12 13 14 15 16 17 18 8 while True: a=input("Enter a vallue for a:") if(a==""): #this checks if enter is pressed in the terminal to quit. 11 break else: a=float(a) #converting the value of a if enter is not pressed. b=input("Enter a value for b:") b=float(b) #converting the value of b to float. c=input("Enter a value for c:") c=float(c) #converting the value of c. if(b*b-4*a* c 0): x1=(-b+math.sqrt(b*b-4*a*c))/2*a #just using the formula to compute the value x1=str(x1) #converting it back to string. x2=(-b-math.sqrt(b*b-4*a*c))/2*a 28 x2=str(x2) print("two solutions:"+x1+", "+x2) #printing the two values. 2e 27 23 2A 25 26 To keep the problem simple we can assume that the user never enters a value for coefficient a that is equal to 0. To stop the loop and end the program the user just types the ENTER key instead of the string for coefficient a. 2. Within the main loop, after printing the values of the real solutions (if any) to the terminal the program displays the graphic of the quadratic function y=ax+bx+c using the matplotlib.pyplot module. The chart should use 150 points. If the function has real roots (one or two) make sure the roots are visible on the chart. E.g. if the roots are -1 and 3 use a domain interval for values x (on the Ox axis) that includes -1 and 3, like [-3, 5]. If the function has no real roots, then center the function domain (x values) on the function's -1 minimum or maximum value, which is Xopt=_=. Pick your own approach to select the function's domain while complying with the above requirements. 2a

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_2

Step: 3

blur-text-image_3

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

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

2. In what ways have your peers and your parents helped shape you?

Answered: 1 week ago