0% found this document useful (0 votes)
2 views1 page

Room Pesudocode

The document outlines a program that calculates the total area of a house based on user input for the number of rooms, their names, lengths, and widths. It validates the number of rooms to be between 3 and 20, computes the area for each room, and identifies the largest and smallest rooms. Finally, it displays the total area, average area of the rooms, and the dimensions of the largest and smallest rooms.

Uploaded by

Huzaifa Zaheer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Room Pesudocode

The document outlines a program that calculates the total area of a house based on user input for the number of rooms, their names, lengths, and widths. It validates the number of rooms to be between 3 and 20, computes the area for each room, and identifies the largest and smallest rooms. Finally, it displays the total area, average area of the rooms, and the dimensions of the largest and smallest rooms.

Uploaded by

Huzaifa Zaheer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

TotalArea=0

// Taking input of the number of rooms and validating it


REPEAT
OUTPUT"Enter the number of rooms in your house between 3 and 20."
INPUT Number
UNTIL Number >= 3 AND Number <= 20

FOR RoomCount = 1 TO Number


// Taking input of room name
OUTPUT"Enter your room name"
INPUT Rooms[RoomCount]

// Taking input for the room dimensions


OUTPUT"Enter your room length in meters"
INPUT Dimensions[RoomCount, 1]

OUTPUT"Enter your room width in meters"


INPUT Dimensions[RoomCount, 2]

// Calculating the area for the room


Dimensions[RoomCount, 3]=
ROUND(Dimensions[RoomCount,1]*Dimensions[RoomCount,2],2)
TotalArea= TotalArea + Dimensions[RoomCount, 3]

// Displaying results for each room


OUTPUT "Your Room Name is:",Rooms[RoomCount]
OUTPUT "Your Room Length is:",Dimensions[RoomCount, 1]
OUTPUT "Your Room Width is:", Dimensions[RoomCount, 2]
NEXT RoomCount

LargestRoom=Dimensions[1,3]
SmallestRoom=Dimensions[1,3]
FOR RoomCount = 2 TO Number
// Finding Largest Room
IF Dimensions[RoomCount, 3] > LargestRoom
THEN
LargestRoom= Dimensions[RoomCount,3]
ENDIF
// Finding Smallest Room
IF Dimensions[RoomCount, 3] < SmallestRoom
THEN
SmallestRoom= Dimensions[RoomCount, 3]
ENDIF
NEXT RoomCount

// Average area of all rooms


AverageSize = ROUND(TotalArea / Number, 2)
//Displaying the Overall Results

OUTPUT "The total area of your house is:", TotalArea


OUTPUT "The average area of all rooms is:", AverageSize
OUTPUT "The Largest Room is:", LargestRoom
OUTPUT "The Smallest Room is:", SmallestRoom

You might also like