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. 25 marks in this lab are for good class structure and good decisions regarding inheritance/composition. 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. 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). PART TWO The society now wants to extend this system so that they can store information about the name of a house’s owner (string). Since you used Object Oriented Design, making this change should take no time. In the main function, after creating the Society object and before society.display(), set the owner names of a few houses, and make sure that society.display() displays this information. The main function will look like this: (Shown in figure) ...

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

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. 25 marks in this lab are for good class structure and good decisions regarding inheritance/composition.
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.
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).
PART TWO
The society now wants to extend this system so that they can store information about the name of a house’s owner (string). Since you used Object Oriented Design, making this change should take no time.
In the main function, after creating the Society object and before society.display(), set the owner names of a few houses, and make sure that society.display() displays this information. The main function will look like this:
(Shown in figure) ...


int main()
{
Society society;
society.set(block,sector,street,house, owner_name);
society.display();
return 0;
Transcribed Image Text:int main() { Society society; society.set(block,sector,street,house, owner_name); society.display(); return 0;
Output screenshot:
Bahria Town
Block A
Lahore
Sector A
Street 1
House 1
House 2
House 3
House 4
House 5
Street 2
House 6
House 7
House 8
House 9 Ouпег: Janshed
House 10
House 11
House 12
House 13
House 14
House 15
Sector B
Street 3
House 16
House 17
Ouner: Afzal
House 18
Block B
Sector C
Street 4
House 19
Owner: Muntazir
Block C
Sector D
Street 5
House 20
Make user manual to set the ownership and display. Program will terminate on pressing a specific key.
Transcribed Image Text:Output screenshot: Bahria Town Block A Lahore Sector A Street 1 House 1 House 2 House 3 House 4 House 5 Street 2 House 6 House 7 House 8 House 9 Ouпег: Janshed House 10 House 11 House 12 House 13 House 14 House 15 Sector B Street 3 House 16 House 17 Ouner: Afzal House 18 Block B Sector C Street 4 House 19 Owner: Muntazir Block C Sector D Street 5 House 20 Make user manual to set the ownership and display. Program will terminate on pressing a specific key.
Expert Solution
steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education