Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 !

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual Basic.NET

Authors: Ying Bai

1st Edition

0521712351, 978-0521712354

More Books

Students also viewed these Databases questions

Question

=+ d. What happens to Oceanias trade balance?

Answered: 1 week ago

Question

=+ e. What happens to Oceanias real exchange rate?

Answered: 1 week ago