Thread 2, Day 11 - Tuesday, January 31, 2023
Agenda
-
Mid-module Portfolio Reviews
- An informal check-in on your progress with:
- Building user interfaces
- Applying abstraction to eliminate repetitive code
- Understanding how to use lists / arrays
- Writing apps that accept input, process it, and produce output
- An informal check-in on your progress with:
-
Refactoring Code for Better Readability
- How to use search and replace
- locally within a file
- globally within a project
- Edit all in scope
- Please watch the video included above and try out some of the features shown within in one of your own projects
NoteThis topic is shared today by video to allow Mr. Gordon more time to meet with students today for portfolio reviews. The video was recorded in class with the other section of Grade 11 Intro to Computer Science last Saturday.
- How to use search and replace
-
Optionals
- You already understand how to use typical data types such as
Int
,Double
,String
, andBool
- You have built applications that accept user input as a
Double
via theSlider
structure in SwiftUI- Sliders prevent the user from providing invalid input
- This is very helpful
- However, it can be hard to select a precise value
- Sometimes, it would be preferable to accept typed input from the user
- But what happens when invalid input is received from a user?
- For example, we might expect numeric input, but the user could type
fifty
rather than50
- This is when the notion of an optional data type becomes useful
- Sliders prevent the user from providing invalid input
- Please fork and clone this project
- Using your black notebook, try each page of the playground
- Take your time – read for understanding – write down your responses to the questions posed in your black book
- When you are done – summarize in writing what you have learned in your Spaces post for today – as well as any questions you have
- Be sure to include several screenshots showing your progress as you completed the playground
- You already understand how to use typical data types such as
To-do items
Before our next class...