- 📚 Read Keyboard Input. Take notes on how to read from
stdin
. - 📚 Read Variables and review what you learned in the tutorial.
📹 If you prefer to watch a video, scroll down to the bottom of the page. - ✅ Complete the following exercises, using what you learned above as a guide:
- Write a program that calculates the year using a provided date of birth and age. HINT: Get the date of birth and age from
stdin
! - Write a program that calculates the average weight of 5 people.
- Write a program that calculates the year using a provided date of birth and age. HINT: Get the date of birth and age from
- Paste the code for each solution in the Warm Up 1: Keyboard Input & Variables worksheet on Gradescope.
- At the end of the warm up, submit whatever you have complete!
- If you finish early, take a break until class starts.
- It's okay if you didn't finish! You'll still earn credit for participating.
-
📚 Read Structs.
-
📚 Read While Loops.
-
✅ Write a program that solves the problem below, using what you learned above as a guide:
-
Declares a public
struct
that represents a house. -
The struct should contain variables
numberOfRooms
,city
,address
, andprice
, each assigned their appropriate data type (string, int, etc) -
When your program runs, allow users to enter information for one to many houses.
-
After the user submits all their information, print a list of the houses for sale in the following format:
123 Address Road San Francisco 8 Rooms $123,456 456 Another Ln Pittsburgh 4 Rooms $90,000
-
-
At the end of the warm up, submit whatever you have complete!
- If you finish early, take a break until class starts.
- It's okay if you didn't finish! You'll still earn credit for participating.