Question: ( 3 0 % ) Conditionals, Logical Operators, and Loops. Problem 4 . 1 . ( 1 0 % ) Consider the quadratic equation a

(30%) Conditionals, Logical Operators, and Loops.
Problem 4.1.(10%) Consider the quadratic equation ax2+bx+c=0, where a,b, and c are given
constants. Using conditional statements, display the following text for the 3 possible cases:
Case 1. "Real and distinct roots" when b2>4ac.
Case 2. "Real and repeated roots" when b2=4ac.
Case 3. "Complex roots" when b24ac,
Case 4. "Invalid entry" when none of the previous conditions is met.
Additionally, display the solutions (roots) of the quadratic equation. Test your code with 3 different sets of
values of a,b, and c of your choice, so that each of the three possible outcomes of your code are evaluated.
Problem 4.2.(10%) Consider the following piecewise function y(x). Use FOR loops and IF conditional
statements to construct 5 different y vs.x plots. Each plot will consider a specific value for a in the range 0
a20(e.g.,a=1,5,9,13,17). Display all 5 plots on the same figure.
xyx1010ARATA,RT
( 3 0 % ) Conditionals, Logical Operators, and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!