Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is a pyhton exercise and I already completed Task 1 and 2! Just need some help with Task 3 and 4! By first executing

This is a pyhton exercise and I already completed Task 1 and 2! Just need some help with Task 3 and 4!

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

By first executing your code you should obtain the following: Welcome to Quadratic Solver for f(x)-ax**2+bx+c Enter value for a: 2 Enter value for b: 3 Enter value for c: 1 Equation is: f(x)-2.0x* 2+3.0x+1.0 Press Enter to continue. . . By order, (1) the code is printing the welcome statement "Welcome to Quadratic Solver for f(x)-ax**2+bx+c" (2) it is then skipping a line, (3) ask the user to enter a value for a, for b and for c (we use 2, 3, 1, respectively, for this example), (4) skip a line again, (5) return the expression of the quadratic function f (x), (6) skip a line, (7) wait for the user to press Enter/Return before to process further What you need to implement 1. A function my quad equation that should accept a,b,c and should display or return the equation (String). The input coefficients a,b,c are considered float and could be converted to string before display 2. the Press Enter to continue... wait instruction (including 'line skipping'), could simply be achieved by adding this line to the program temp input (" Press Enter to continue ") # wait where temp is just a temporary unused variable Task-2- [15pts] Let us continue with the execution of the program: Welcome to Quadratic Solver for f(x)-ax**2+bx+c Enter value for a: 2 Enter value for b: 3 Enter value forc:1 Equation is: f (x)-2.0x**2+3.0x+1.0 Press Enter to continue... Enter value for x: 3 f (3.0)- 28.0 Press Enter to continue... The program is then asking the user to enter a value x (we choose 3 here), and it will return the value of the quadratic function for this specific x (i.e. f(x)). We then skip a line and wait again for the user to press Enter/Return before to process further. What you need to implement: 1. a new function evaluate quad equation that should accept the coefficients a,b,c and the variable x as arguments and return the value of f(x). Task-3- [15pts] Let us continue then with the program execution: Welcome to Quadratic Solver for f(x)-ax* 2+bx+c Enter value for a: 2 Enter value for b:3 Enter value for c: 1 Equation is : f (x)#2 . 0x** 2+3 . Ox+ 1 . 0 Press Enter to continue... Enter value for x: 3.0 f (3.0)- 28.0 Press Enter to continue. .. f(x) has a minimum at xo--o .75 with value f (x0)--0.125 Press Enter to continue.. A quadratic equation is mainly a parabola which goes through an extremum that could be a minimum if a>0 or a maximum if a 0 like in this case, the program wil1 return two real solutions -b-Vd , and r2- 0 If d = 0 the program should return only one real solution Zo =-b/(2a) (which happened to be the extremum already calculated in Task-3). If you choose the inputs a-1, b-2, c-1, the output (at this stage of the execution) should look like Press Enter to continue. Solving for f(x)-0 Discriminant is 0.0 One real solution: -1.0 Thanks for using Quadratic solver!, come back soon If d 0.0 and d

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

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions