Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 2.38 KB

File metadata and controls

41 lines (31 loc) · 2.38 KB

Syntax Drills & Warm Ups

Table of Contents

[45m] ☀️ Warm Up 1: Keyboard Input & Variables

  1. 📚 Read Keyboard Input. Take notes on how to read from stdin.
  2. 📚 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.
  3. 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.
  4. Paste the code for each solution in the Warm Up 1: Keyboard Input & Variables worksheet on Gradescope.
  5. At the end of the warm up, submit whatever you have complete!
    1. If you finish early, take a break until class starts.
    2. It's okay if you didn't finish! You'll still earn credit for participating.

[30m] ☀️ Warm Up 2: Structs & While Loops

  1. 📚 Read Structs.

  2. 📚 Read While Loops.

  3. 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, and price, 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
  4. At the end of the warm up, submit whatever you have complete!

    1. If you finish early, take a break until class starts.
    2. It's okay if you didn't finish! You'll still earn credit for participating.