1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mylen [45]
3 years ago
10

Create a program named PaintingDemo that instantiates an array of eight Room objects and demonstrates the Room methods. The Room

constructor requires parameters for length, width, and height fields (all of type int); use a variety of values when constructing the objects. The Room class also contains the following fields: Area - The wall area of the Room (as an int) Gallons - The number of gallons of paint needed to paint the room (as an int)
Engineering
1 answer:
Serggg [28]3 years ago
3 0

Answer:

Explanation:

Code used will be like

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace PaintingWall

{

class Room

{

public int length, width, height,Area,Gallons;

public Room(int l,int w,int h)

{

length = l;

width = w;

height = h;  

}

private int getLength()

{

return length;

}

private int getWidth()

{

return width;

}

private int getHeight()

{

return height;

}

public void WallAreaAndNumberGallons()

{

Area = getLength() * getHeight() * getWidth();

if (Area < 350)

{

Gallons = 1;

}

else if (Area > 350)

{

Gallons = 2;

}    

Console.WriteLine ("The area of the Room is " + Area);

Console.WriteLine("The number of gallons paint needed to paint the Room is " + Gallons);

}

 

}

class PaintingDemo

{

static void Main(string[] args)

{

int l, w, h;

Room[] r = new Room[8];

for (int i = 0; i <= 7; i++)

{

Console.WriteLine("Room "+(i+1));

Console.Write("Enter Length : ");

l = Convert.ToInt32(Console.ReadLine() );

Console.Write("Enter Width : ");

w = Convert.ToInt32(Console.ReadLine());

Console.Write("Enter Height : ");

h= Convert.ToInt32(Console.ReadLine());

r[i] = new Room(l,w,h);

Console.WriteLine();

}

for (int i = 0; i <= 7; i++)

{

Console.WriteLine("Room " + (i + 1));

r[i].WallAreaAndNumberGallons();

}

Console.ReadKey();  

}

}

}

You might be interested in
2. There are three drawings that architects and designers use to indicate spaces. What are these drawing?
Zarrin [17]

Answer:

Architectural plans.

Explanation:

An architectural plan is called the drawings made by architects, civil engineers or designers of spaces or interiors, in which these professionals capture their building projects, organizing the distribution of the spaces to be used, the elements to be located in them and, fundamentally, to give construction planning a projection into reality. Thus, the plans help professionals to have a better understanding of the expected end result of the projects they are carrying out.

3 0
3 years ago
By adding "-once", one can form the noun form of the word "organize" is that true or false?​
denpristay [2]

Answer:

<h2>False </h2>

Explanation:

The noun form of organize is just adding letter r

7 0
3 years ago
Read 2 more answers
Pouring molten aluminum into a mold and allowing it to cool forms?
neonofarm [45]

Answer:it forms a molten mold that makes it hard to be able to smash something into it then make something like a key

Explanation:

7 0
3 years ago
The substance is steam (H2O). NOTE: The purpose of this problem is to illustrate that there are conditions where water vapor is
Gennadij [26K]

Answer:

See the attached pictures for detailed answer.

Explanation:

See the attached pictures for step by step explanation.

7 0
3 years ago
Which of the following describes the most direct and attainable way to reduce pollution in the environment?
kirill115 [55]

Answer:

i think its A. increasing research to find alternative natural resources for the future

5 0
3 years ago
Read 2 more answers
Other questions:
  • Some cars have an FCW, which stands for
    13·1 answer
  • A car air-conditioning unit has a 0.5-kg aluminum storage cylinder that is sealed with a valve, and itcontains 2 L of refrigeran
    5·1 answer
  • Water vapor at 6 MPa, 600 degrees C enters a turbine operating at steady state and expands to 10kPa. The mass flow rate is 2 kg/
    14·1 answer
  • A car generator turns at 400 rpm (revolutions per minute) when the engine is idling. It has a rectangular coil with 300 turns of
    7·1 answer
  • A closed, rigid tank fitted with a paddle wheel contains 2.0 kg of air, initially at 200oC, 1 bar. During an interval of 10 minu
    8·1 answer
  • Which is the required type of fire extinguisher for standard naval vessels
    9·1 answer
  • How to update android 4.4.2 to 5.1 if there isnt any update available​
    15·2 answers
  • Which of the following machine parts always require
    12·1 answer
  • While recharging a refrigerant system, the charging stops before the required amount of refrigerant has been inserted. What shou
    8·1 answer
  • which of the following tools is used for measuring small diameter holes which a telescoping gauge cannot fit into? A. telescopin
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!