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
You should use the pass technique a fire extinguisher
PilotLPTM [1.2K]

Answer:

Yes

Explanation:

8 0
3 years ago
Xyxyydfufggivivihogcufuf​
Genrish500 [490]

Answer:

ummm why is you doing this

Explanation:

It doesnt make sense.

7 0
3 years ago
Water flows steadily through the pipe as shown below, such that the pressure at section (1) and at section (2) are 300 kPa and 1
steposvetlana [31]

Answer:

The velocity at section is approximately 42.2 m/s

Explanation:

For the water flowing through the pipe, we have;

The pressure at section (1), P₁ = 300 kPa

The pressure at section (2), P₂ = 100 kPa

The diameter at section (1), D₁ = 0.1 m

The height of section (1) above section (2), D₂ = 50 m

The velocity at section (1), v₁ = 20 m/s

Let 'v₂' represent the velocity at section (2)

According to Bernoulli's equation, we have;

z_1 + \dfrac{P_1}{\rho \cdot g} + \dfrac{v^2_1}{2 \cdot g} = z_2 + \dfrac{P_2}{\rho \cdot g} + \dfrac{v^2_2}{2 \cdot g}

Where;

ρ = The density of water = 997 kg/m³

g = The acceleration due to gravity = 9.8 m/s²

z₁ = 50 m

z₂ = The reference = 0 m

By plugging in the values, we have;

50 \, m + \dfrac{300 \ kPa}{997 \, kg/m^3 \times 9.8 \, m/s^2} + \dfrac{(20 \, m/s)^2}{2 \times 9.8 \, m/s^2} = \dfrac{100 \ kPa}{997 \, kg/m^3 \times 9.8 \, m/s^2} + \dfrac{v_2^2}{2 \times 9.8 \, m/s^2}50 m + 30.704358 m + 20.4081633 m = 10.234786 m + \dfrac{v_2^2}{2 \times 9.8 \, m/s^2}

50 m + 30.704358 m + 20.4081633 m - 10.234786 m = \dfrac{v_2^2}{2 \times 9.8 \, m/s^2}

90.8777353 m = \dfrac{v_2^2}{2 \times 9.8 \, m/s^2}

v₂² = 2 × 9.8 m/s² × 90.8777353 m

v₂² = 1,781.20361 m²/s²

v₂ = √(1,781.20361 m²/s²) ≈ 42.204308 m/s

The velocity at section (2), v₂ ≈ 42.2 m/s

3 0
2 years ago
What is an example of a product made of textile?
Otrada [13]

beach \: towel \\  \\ hope \: it \: helps

4 0
2 years ago
Which option identifies the type of device the engineer will develop in the following scenario?
Stells [14]
It would be actuator
4 0
2 years ago
Read 2 more answers
Other questions:
  • . A storm sewer is carrying snow melt containing 1.200 g/L of sodium chloride into a small stream. The stream has a naturally oc
    8·1 answer
  • Evan notices a small fire in his workplace. Since the fire is small and the atmosphere is not smoky he decides to fight the fire
    10·1 answer
  • Power is a fundamental dimension. a) True b) False
    15·1 answer
  • Which of the following best describes a central idea of the text?
    10·1 answer
  • : A cyclical load of 1500 lb is to be exerted at the end of a 10 in. long aluminium beam (see Figure below). The bar must surviv
    6·1 answer
  • True or false <br> 19. Closed systems rely on feedback from outside of the system to operate.
    12·1 answer
  • Please help me with this. Picture
    10·1 answer
  • Technician A says that the enable criteria are the criteria that must be met before the PCM completes a monitor test. Technician
    8·1 answer
  • A cantilever beam AB of length L has fixed support at A and spring support at B.
    11·1 answer
  • During welding in the vertical position, the torch angle can be varied to control sagging.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!