You are building a system for a Housing Society, such as Bahria Town. You are supposed to design a system that allows them to keep a record of how many blocks, sectors, streets, and houses the society has. Your system also generates unique names for blocks and sectors, and unique numbers of streets and houses. You must design the class structure yourself. 5 marks in this lab are for good class structure and good decisions regarding inheritance. A society has many blocks, each block has many sectors, each sector has many streets, and each street has many houses. The society has a name, each block has a name (an alphabet), each sector has a name (an alphabet), each street has a number, and each house also has a unique house number. When your program starts: • It asks the user the name of the Society as well as the City in which it is located. Your program should be able to handle input that has more than one words. • Then, it asks the user how many blocks does this society has. Let’s say the user says 3. The 3 blocks are named Block A, Block B, and Block C automatically by your system. • While creating each Block, you ask the user how many sectors exist in each block. Let’s say that while creating Block A, the user says that this block has 2 sectors. Your system will automatically name these sectors Sector A and Sector B. • While creating each Sector, the system asks the user how many streets the sector has. Let’s say that while creating the Sector A, the user says that it has 3 streets. Your system will automatically name these streets Street 1, Street 2, and Street 3. • While creating a street, the system asks the user how many houses there are in the street. Let’s say the user says 10 houses for Street 1, your system will automatically name these houses House 1, House 2, …, House 10. If the user adds 5 houses to Street 2, these houses will be named House 11, House 12, …, House 15. Course Title: Object Oriented Programming Course Code: Credit Hours: 4 Lab Instructor: Mr. Ali Usman Program Name: BS(CS) + Repeaters Semester: Batch: Section: Date: 10-05-2021 Time Allowed: 150 Minutes Maximum Marks: 30 Student’s Name: Reg. No. CUI/ /SWL Important Instructions / Guidelines: 1. Copied papers will be marked as zero 2. paper submitted after assigned time will not be accepted 3. Paper must include (Name, Roll-no#) otherwise paper will not be accepted. No two houses in the society can have the same number. No two streets in the society can have the same number. No two sectors can have the same alphabet (you can assume that the user won’t ask for more than 26 sectors in total). No two blocks will have the same alphabet (assume total blocks < 26). Once the input is taken and the society has been created, display the society. For example, look at this display: This display shows that this society had three blocks: Block A, Block B, and Block C. • Block A had 2 sectors named Sector A and Sector B. Sector A had 2 streets: Street 1 and Street 2. Street 1 had 5 houses, whereas Street 2 had 10 houses. Sector B had one street: Street 3 which had 3 houses. • Block B had one sector, one street, and one house. • The same goes for Block C. Marks will be deducted if your output is messy and not properly indented. The main function only includes the following code: The line Society society; creates the society and all of its sub-structures and takes all the input required. The line society.display(); displays the society as shown in the screenshot above.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

You are building a system for a Housing Society, such as Bahria Town. You are supposed to design a system
that allows them to keep a record of how many blocks, sectors, streets, and houses the society has. Your
system also generates unique names for blocks and sectors, and unique numbers of streets and houses.
You must design the class structure yourself. 5 marks in this lab are for good class structure and good
decisions regarding inheritance.
A society has many blocks, each block has many sectors, each sector has many streets, and each street
has many houses. The society has a name, each block has a name (an alphabet), each sector has a name
(an alphabet), each street has a number, and each house also has a unique house number.
When your program starts:
• It asks the user the name of the Society as well as the City in which it is located. Your program
should be able to handle input that has more than one words.
• Then, it asks the user how many blocks does this society has. Let’s say the user says 3. The 3 blocks
are named Block A, Block B, and Block C automatically by your system.
• While creating each Block, you ask the user how many sectors exist in each block. Let’s say that
while creating Block A, the user says that this block has 2 sectors. Your system will automatically
name these sectors Sector A and Sector B.
• While creating each Sector, the system asks the user how many streets the sector has. Let’s say
that while creating the Sector A, the user says that it has 3 streets. Your system will automatically
name these streets Street 1, Street 2, and Street 3.
• While creating a street, the system asks the user how many houses there are in the street. Let’s
say the user says 10 houses for Street 1, your system will automatically name these houses House
1, House 2, …, House 10. If the user adds 5 houses to Street 2, these houses will be named House
11, House 12, …, House 15.
Course Title: Object Oriented Programming Course
Code: Credit Hours: 4
Lab Instructor: Mr. Ali Usman Program Name: BS(CS) + Repeaters
Semester: Batch: Section: Date: 10-05-2021
Time Allowed: 150 Minutes Maximum Marks: 30
Student’s Name: Reg. No. CUI/ /SWL
Important Instructions / Guidelines:
1. Copied papers will be marked as zero
2. paper submitted after assigned time will not be accepted
3. Paper must include (Name, Roll-no#) otherwise paper will not be accepted. No two houses in the society can have the same number. No two streets in the society can have the same
number. No two sectors can have the same alphabet (you can assume that the user won’t ask for more
than 26 sectors in total). No two blocks will have the same alphabet (assume total blocks < 26).
Once the input is taken and the society has been created, display the society. For example, look at this
display:

This display shows that this society had three blocks: Block A, Block B, and Block C.
• Block A had 2 sectors named Sector A and Sector B. Sector A had 2 streets: Street 1 and Street 2.
Street 1 had 5 houses, whereas Street 2 had 10 houses. Sector B had one street: Street 3 which
had 3 houses.
• Block B had one sector, one street, and one house.
• The same goes for Block C. Marks will be deducted if your output is messy and not properly indented.
The main function only includes the following code:
The line Society society; creates the society and all of its sub-structures and takes all the input
required.
The line society.display(); displays the society as shown in the screenshot above.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY