BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VEVENT
URL:https://www.learndesk.us/class/6534923311644672/lesson/0fbe07f8a43ae74f84dc971f34fa1b79?ref=outlook-calendar
SUMMARY:Notes
DTSTART;TZID=America/Los_Angeles:20260504T190000
DTEND;TZID=America/Los_Angeles:20260504T200000
LOCATION:https://www.learndesk.us/class/6534923311644672/lesson/0fbe07f8a43ae74f84dc971f34fa1b79?ref=outlook-calendar
DESCRIPTION: Week 7 Notes
=====================================================================
* Homework Solution

 - What examples you came up with?

- Here's an example:
  - How do you represent a bank account in your application?

class BankAccount {
    var number: Int
    var owner: String
    var balance: Float   

      init(owner: String) {
          self.number = 12389 // generatesANewAcctNumber()
      	  self.owner = owner
	  self.balance = 0
      }
}

  - What functions do you see this class having?

      func deposit(amount: Float) {
          self.balance += amount
      }
      
      func withdraw(amount: Float)  {
	  self.balance -= amount
      }

  - Is the withdraw(Float) method valid?
    - No, it allows balance to go negative.
    - How to fix?

      func withdraw(amount: Float) -> Bool  {
          if self.balance >= amount {
	      self.balance -= amount
              return true
          }
          return false
      }
      
    - Uses the return value to...

https://www.learndesk.us/class/6534923311644672/lesson/0fbe07f8a43ae74f84dc971f34fa1b79?ref=outlook-calendar
STATUS:CONFIRMED
SEQUENCE:3
BEGIN:VALARM
TRIGGER:-PT10M
DESCRIPTION:Class Reminder
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR