Explore BrainMass
Share

Program to Find the Room with the Largest Perimeter

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

Write a program that prompts for the number of rooms in a house. Use the input, n, to declare an array of rectangles dynamically. In a loop, input the dimensions for the n rooms, and then output the total area of the house. Scan the array to identify the room with the largest perimeter, and output its dimensions.

Specifications:
This program prompts the user for a number of rooms in a house.
creates dynamically an array of rectangles to hold the dimensions of each room.
calculates and output the total area of the house
identifies the room with the largest perimeter and output it's dimensions.
the main file to use is:

#include "d_rect.h"

© BrainMass Inc. brainmass.com March 21, 2019, 4:03 pm ad1c9bdddf
https://brainmass.com/computer-science/arrays/program-room-largest-perimeter-172228

Solution Summary

C++ program attached takes number and size of rooms as input and finds the total area of the house as well as the room with the largest perimeter. Program output also attached in Word.

$2.19