Question: please use python 3 4330 Assignment 2.1 Write your code for the following problems in a single file named: hw2-lastname.py Please: name your file in

please use python 3
4330 Assignment 2.1 Write your code for the following problems in a single file named: hw2-lastname.py Please: name your file in exactly this way, lowercase 'hw', a dash (not an underscore), and NO SPACES in the filename! (1) (20 points) Download the file hw2.py accompanying this assignment. Insert a comment at the top with your name and date. (i) Determine the intended purpose of the program. (The calculation should look roughly familiar to you). (ii) By hand, compute two fairly general examples of possible input values and what the corresponding output values should be, if the program worked correctly. Put those in the comments of your code. (iii) Correct the mistakes and errors, so the program works properly. Use your two examples to test it. (iv) Insert appropriate comments, prompts for the input (so the user knows what they're entering), and add additional information to the output describing what it is. (v) What happens if the value zero is supplied for a? You need not correct this error or account for it - just find out what happens, and add a print statement describing what happens. hw2.py # This program has many problems, and will NOT run as-is. # For part of this assignment, you need to correct it. # the 'a' variable may be undefined 1 2 3 4 5 6 7 8 9 10 11 12 13 x1 = (-b + (b**2 4*a*c)**1/2)/2 x2 = (-b - (b**2 - 4*a*c)**1/2)/2a a = float(input) b = float(input()) float(input) print (x1,x2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
