Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am trying to write a program that solves the quadratic equation. When i type this is for x1 = -b +(b** 2 -4*a*c)** 0.5
I am trying to write a program that solves the quadratic equation. When i type this is for x1 = -b +(b** 2 -4*a*c)** 0.5 /2*a
it gives me the wrong answer
Overview Write a program that solves quadratic equations. Description Write a program that solves for x in a quadratic equation of the form ar? + bc+c=0 This is done by plugging in the values of a, b, and c into the Quadratic Formulas: -b+ b2 - 4ac -b- b2 - 4ac - and 22 = - =- 2a 2a Notice that there are two formulas. This will calculate two different x values. Hint 1: You can perform a square root operation by raising to the 0.5 power. For instance: (10*x) **0.5 Will multiply x by 10 and take the square root of the result. Hint 2: If you are getting incorrect numbers, check to make sure you are using parentheses correctly! Note: Do not enter 0 as a value for a, since division by 0 is illegal and the quadratic formula is only defined when a is not 0. Objective The objective of this lab is to practice writing complex formulas using Python. Ex: If the input is: LAB ACTIVITY 16.5.1: LAB 4 A: Expressions: Quadratic Formula 5/20 main.py Load default template... 1 a = int(input("Enter a: ")) 2 b = int(input("Enter b: ")) 3 c = int(input("Enter c: ")) m+ONO x1 = None #Replace None with your calculation of x1 6 x2 = None #Replace None with your calculation of x1 8 print("x1:",x1) 9 print("x2:",x2)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started