Question: language swift, please try it in the IBM Swift Sandbox version 3.3 before post it. thanks ! ey ldeas: Discussion of basic Swift operators, boolean

language "swift", please try it in the IBM Swift Sandbox version 3.3 before post it. thanks !

 language "swift", please try it in the IBM Swift Sandbox version

ey ldeas: Discussion of basic Swift operators, boolean expressions, using if to make choices, a quick look at the idea of functions Using variables, expressions, and if-statements, write a snippet of code that will find the solutions to a quadratic equation given a, b, c as Doubles. For example the following code: import Foundation import Glibc let a = 1.0 let b 5.0 let c = 6.0 var solutionl: Double-0.0 va r solution2: Double = 0.0 var numbersolut ions : Int = 0 let discriminant = //Your Code Here print ("discriminant: (discriminant) ") print ("Number Solution: \(numbersolutions) ") print("Solutionl: \(solution1)") print("Solution2: \(solution2) ") Should result in the printout: discriminant : 1 . 0 Number Solution: 2 Solutionl: -2.0 Solution2: -3.0 Note: You will need the import statements as shown above. Note: You can take the square root of example: a number using the sqrt function. For let example - sqrt (16) Would result in example being set to 4.0 Note: Quadratic formula is The quadratic formula

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 Databases Questions!