Ask Question
24 September, 20:23

Given that a function name f receives three parameters a, b, c, of type double, write some code, to be included as part of the function, that determines whether the value of "b squared" - 4ac is negative. If negative, the code prints out the message "no real solutions" and returns from the function.

+4
Answers (1)
  1. 24 September, 20:52
    0
    def calculatereality (a, b, c):

    if (pow (float (b),2) - 4*float (a) * float (c)) >=0:

    print ("real solutions")

    else:

    print ("no real solutions")

    calculatereality (12,234,12) #This is for output check

    Explanation:

    The function required is written above. It prints imaginary or real values according to the calculations b^2-4*a*c.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Given that a function name f receives three parameters a, b, c, of type double, write some code, to be included as part of the function, ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers