subject
Computers and Technology, 08.05.2021 14:00 pino40

You are building a system for a Housing Society, such as Bahria Town. You are supposed to design a very simple 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 System Structure.
A society has many blocks (A Link List), each block has many sectors (A link List), each sector has many
streets (A link List), and each street has many houses (A link List). 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.
Note:
Society is a HEAD NODE.
All Other Node Types can have inherited from Node of type Society. So all nodes can point parent
or child nodes types in any arbitrary order.
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: Algorithms and Data Structures Course
Code:
CSC211 Credit Hours: 4
Lab Instructor: Mr. Ali Usman Program Name: BS(CS)
Semester: Batch: Section: Date: 08-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 has three blocks: Block A, Block B, and Block C.
• Block A has 2 sectors named Sector A and Sector B. Sector A has 2 streets: Street 1 and Street 2.
Street 1 has 5 houses, whereas Street 2 has 10 houses. Sector B has one street: Street 3 which has
3 houses.
• Block B has 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 should only include 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.
int main() {
Society society;
society. display();
return 0;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 13:20
Arectangular room is 4 meters longer than it is wide and its preimeter is 32 meters find the dimensions of the room
Answers: 3
question
Computers and Technology, 22.06.2019 13:00
We as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in a computer’s language, however, it is preferred to have the operators on the right side of the operands, i.e. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix.write a program that takes an “infix” expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % (example infix expression: (7 - 3) / (2 + 2)postfix expression: 7 3 - 2 2 + /result: 1guidelines: 1. you will need to use stacks in three placesa. one for the parenthesis check [char stack]b. one during infix to postfix [char stack]c. one during evaluation [int stack]for a and b above, you can use same array and same push, pop method as both ofthem are char. but for evaluation you have int stack and you might consider to createanother push pop method to handle it. maybe push_int, pop_int, etc. or find otherstrategy to utilize existing push pop method2. you can create a function for obtaining operator priority. that function should take anoperator as input and return its priority as an integer. this function will you a lot andreduce repeated code3. during evaluation you will need to convert char into integer. example for single digit: char c = '5'; int x = c - '0';
Answers: 2
question
Computers and Technology, 22.06.2019 14:20
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
question
Computers and Technology, 22.06.2019 15:00
Hyperactive media sales has 10 windows 7 laptop computers used by sales-people in the organization. each laptop computer has several customized applications that are used during the sales process as well as customer relationship management software. all of the applications on the laptops are difficult to configure and have large data files. if all of the laptops have current hardware, what is the easiest way to install windows 10 on them?
Answers: 1
You know the right answer?
You are building a system for a Housing Society, such as Bahria Town. You are supposed to design a v...
Questions
question
Mathematics, 14.04.2021 17:30
question
Mathematics, 14.04.2021 17:30
question
Mathematics, 14.04.2021 17:30
question
Mathematics, 14.04.2021 17:30
question
History, 14.04.2021 17:30