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
the AADT for a section of suburban freeway is 150000 veh/day. Assuming this is an urban radial facility, what range of direction
igomit [66]

Answer:

design hour volumes will be 4000 to 6000

Explanation:

given data

AADT  = 150000 veh/day

solution

we get here design hour volumes that is express as

design hour volumes  = AADT × k × D    ..............1

here k is factor and its  range is 8 to 12 % for urban

and D is directional distribution i.e traffic equal divided by the direction

so here design hour volumes will be 4000 to 6000

7 0
3 years ago
What is the mass of a brass axle that has a volume of 0.318 cm? ​
NeX [460]

Answer:

2.7g

Explanation:

the mass of a brass axle that has a volume of 0.318 cm is 2.7g.

8 0
3 years ago
To become familiar with the general equations of plane strain used for determining in-plane principal strain, maximum in-plane s
lukranit [14]

Answer:

a) -1.46 x 10∧-5, 1.445x 10∧-4, -6.355 x 10∧-4

b) 3.926 x 10∧-4, -2.626 x 10∧-4

c) 6.552 x 10∧-4, 6.5 x 10∧-5

Explanation:

a) -1.46 x 10∧-5, 1.445x 10∧-4, -6.355 x 10∧-4

b) 3.926 x 10∧-4, -2.626 x 10∧-4

c) 6.552 x 10∧-4, 6.5 x 10∧-5

The explanation is shown in the attachment. I hope i have been able to help.

3 0
3 years ago
What effect does air have on the acceleration of aircraft during flight?
scoundrel [369]
The effect would be the altitude of the air, the higher you go up the closer you are to space we’re there’s no oxygen and everything moves slow so when your trying to fly across the world it could feel like your moving slower
5 0
3 years ago
A closed system consisting of 4 lb of a gas undergoes a process during which the relation between pressure and volume is pVn 5 c
gayaneshka [121]

Answer:

V1=5<u>ft3</u>

<u>V2=2ft3</u>

n=1.377

Explanation:

PART A:

the volume of each state is obtained by multiplying the mass by the specific volume in each state

V=volume

v=especific volume

m=mass

V=mv

state 1

V1=m.v1

V1=4lb*1.25ft3/lb=5<u>ft3</u>

state 2

V2=m.v2

V2=4lb*0.5ft3/lb=  <u> 2ft3</u>

PART B:

since the PV ^ n is constant we can equal the equations of state 1 and state 2

P1V1^n=P2V2^n

P1/P2=(V2/V1)^n

ln(P1/P2)=n . ln (V2/V1)

n=ln(P1/P2)/ ln (V2/V1)

n=ln(15/53)/ ln (2/5)

n=1.377

3 0
3 years ago
Other questions:
  • Water at 20 bar and 400 C enters a turbine operating at steady state and exits at 1.5 bar. Stray heat transfer and kinetic and p
    14·1 answer
  • A composite wall is composed of 20 cm of concrete block with k = 0.5 W/m-K and 5 cm of foam insulation with k = 0.03 W/m-K. The
    13·1 answer
  • A structural component in the form of a wide plate is to be fabricated from a steel alloy that has a plane-strain fracture tough
    10·1 answer
  • Which of the following is an example of a reliable source?
    10·1 answer
  • Compare the temperature dependence of Nabarro-Herring and Coble creep. Which is more temperature-sensitive
    15·1 answer
  • The electrical panel schedules are located on EWR Plan number ___.
    13·1 answer
  • Please help with my economics problem
    8·1 answer
  • Porque el invento de la bombilla es importante?
    6·1 answer
  • Concrete ___ support and anchor the bottom of steel columns and wood post, which support beams that are pare of framing system o
    11·1 answer
  • Tech B says that long-term fuel trims that are positive means that the PCM is leaning out the fuel mixture from the base pulse-w
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!