//Here is one of the two temp convert classes that you will need //CtoF Class example import Foundation class CtoF { var temp = 0.0 init(temp: Double) { // Constructor self.temp = temp } var Temp: Double{ return (temp*(9/5)) + 32 } func getTemp() -> Double { return (temp*(9/5)) + 32 } } class Circle { var radius = 0.0 init(radius: Double) { // Constructor self.radius = radius } var Area: Double{ return 3.14*(radius*radius) } func getArea() -> Double { return 3.14*(radius*radius) } var Circumference: Double { return 2*3.14*radius } func getCircumference() -> Double{ return 2*3.14*radius } } //// let temp1 = CtoF(temp: 0.0) print("Celsius to Fahrenheit temperature:",temp1.getTemp()) // access the function print(temp1.Temp); //access the Property /// let circ1 = Circle(radius: 32.0) print("Area:",circ1.getArea()) print("Circumference: ",circ1.getCircumference())
Tuesday, November 14, 2017
Week 13 Swift Demo
IBM Swift Sandbox, online Swift compiler and execution
Tuesday, October 10, 2017
Tuesday, July 18, 2017
Tuesday, April 11, 2017
Tuesday, February 14, 2017
Chapter 6 Array Demo
Step 1) Right click then save content.
Step 2) Open in NotePad++
Step 3) Run->choose browser
Loop Demo
Step 2) Open in NotePad++
Step 3) Run->choose browser
Loop Demo
Tuesday, January 24, 2017
Subscribe to:
Posts (Atom)