/go-structs-while

Go Exercise 2: Structs and While Loops

Primary LanguageGo

Drill 2: Structs + While Loops

Instructions

If you're unable to solve the problem, be sure to submit your code anyway so I can give you partial credit and feedback!

  1. 📚 Read Structs.

  2. 📚 Read While Loops.

  3. ✅ Write a program that solves the problem below, using what you learned above as a guide:

    1. Declares a public struct that represents a house.

    2. The struct should contain variables numberOfRooms, city, address, and price, each assigned their appropriate data type (string, int, etc)

    3. When your program runs, allow users to enter information for one to many houses.

    4. 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