https://learn-us-east-1-prod-fleet02-xythos.content.blackboardcdn.com/5c6c35e035a3c/1450344?X-Blackboard-Expiration=...

https://learn-us-east-1-prod-fleet02-xythos.content.blackboardcdn.com/5c6c35e035a3c/1450344?X-Blackboard-Expiration=1616965200000&X-Blackboard-Signature=sATbfZ6Ox0TuIvKD36FB%2Boi%2Fpi7CZ03JeWEabZYgnZc%3D&X-Blackboard-Client-Id=300032&response-cache-control=private%2C%20max-age%3D21600&response-content-disposition=inline%3B%20filename%2A%3DUTF-8%27%27ContentView.swift%25281%2529.txt&response-content-type=text%2Fplain&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20210328T150000Z&X-Amz-SignedHeaders=host&X-Amz-Expires=21600&X-Amz-Credential=AKIAZH6WM4PL5SJBSTP6%2F20210328%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=02bb424052440f7a64201cdbc31e705a561d741daffbbe3e6814c04902b7d757
For this project we will be writing a quadratic formula calculator. I have some starter code you can use (see the attachment "ContentView.swift.txt").
For this assignment you will need to write 3 functions:


  • The first function, named "clear" that will reset the variables A, B and C, as well as the error variable and the output variable.

  • The second function is called quadratic and will accept 3 double variables (A, B and C) and will return the roots of the quadratic equation. If you need a refresher of the quadric function, please look at


https://en.wikipedia.org/wiki/Quadratic_formulaandhttps://www.calculatorsoup.com/calculators/algebra/quadratic-formula-calculator.php



  • The third function is called execute and will be called when someone clicks on the "solve" button. This function will glue all the pieces together. The execute function should use the ValidateInput function (provided by Billy) to make sure that the values inputted by the user are numbers. The execute function should then call the quadratic function (function # 2) and get the roots of the quadratic function. The execute function should then update the output variable so it displays the roots. See the enclosed images to see how the output should look.



Note: You don't need to change any of the layout code. You only need to define the clear, quadratic and execute functions. If you do those properly, it should work.
Mar 28, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here