-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContents.swift
More file actions
41 lines (35 loc) · 1.24 KB
/
Contents.swift
File metadata and controls
41 lines (35 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import UIKit
//To create a function that will be used to keep track of walking dogs
//data types include: Inteers and Strings
//func walkDog(){
// print("1. Aquire the dog")
// print("2. Put a leash on the dog")
// print("3. Take a poop bag")
// print("4. Walk Outside ")
//}
////declare function
//
//func dogWalking(numberofDogs : Int){
// print("There is/are \(numberofDogs) dogs at this house.")
//}
//dogWalking(numberofDogs : 26)
func hello(){
print("Hello, Chloe!")
}
func hello(name : String){
print("Hello, \(name)!")
}
//hello(name : "Chloe")
//to create a bank account function that takes in the current bank account balance, adds the deposit amount and yeilds a new balance.
//func bankAccount(currentBalance : Double, depositAmount : Double) -> Double{
// let newBalance = currentBalance + depositAmount
// return newBalance
//
//}
func bankAccount2(currentBalance : Double, withdrawalAmount : Double, depositAmount : Double) -> Double{
let newBalance = currentBalance - withdrawalAmount + depositAmount
return newBalance
}
let newBalance2 = bankAccount2(currentBalance : 35.0, withdrawalAmount : 16.50, depositAmount : 15.0)
print("Your new balance is : \(newBalance2) dollars")
var str = "Testing for Git Hub"