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 news media often report an earthquake's magnitude on the Richter scale. Which of the following items are characteristics of
vlabodo [156]

The correct answers are A) determined from the amplitude recorded by a single seismometer. C) represents the amount of energy released. D) uses a logarithmic scale.

The news media often report an earthquake's magnitude on the Richter scale. The following items are characteristics of a Richter earthquake magnitude: determined from the amplitude recorded by a single seismometer, represents the amount of energy released, and uses a logarithmic scale.

When measuring the scale of the magnitude of earthquakes, the Richter scale measures the scale od moderated size earthquakes. It was invented by two United States seismologists: Charles F. Richer and Beno Gutenberg. They developed the measure in California when they were researching from 1927 through 1936, in the Seismological Laboratory of the Carnegie Institution of Washington, in Pasadena, California.

8 0
3 years ago
What is the heat flux (W/m2) to an object when subjected to convection heat transfer environment given: 24 °C = the surface temp
xxMikexx [17]

Answer:

attached below

Explanation:

4 0
3 years ago
A freshly annealed glass containing flaws of maximum length of 0.1 microns breaks under a tensile stress of 120 MPa. If a sample
almond37 [142]

Answer:

0.16 micron per day

Explanation:

Given:

The initial crack length, a₁ = 0.1 micron = 0.1 × 10⁻⁶ m

Initial tensile stress, σ₁ = 120 MPa

Final stress = 30 MPa

now from Griffith's equation, we have

\sigma=[\frac{G_cE}{\pi\ a}]^\frac{1}{2}

where,

Gc and E are the material constants

now,

for the initial stage

120=[\frac{G_cE}{\pi\ (0.1\times10^{-6}}]^\frac{1}{2}  ........{1}

and for the final case

30=[\frac{G_cE}{\pi\ a_2}]^\frac{1}{2}   ............{2}

on dividing 1 by 2, we get

\frac{120}{30}=[\frac{a_2}{0.1\times10^{-6}}]^\frac{1}{2}

or

a₂ = 4² × 0.1 × 10⁻⁶ m

or

a₂ = 1.6 micron

Now,

the change from 0.1 micron to 1.6 micron took place in 10 days

therefore, the rate at which the crack is growing = \frac{1.6-0.1}{10}

or

average rate of change of crack = 0.16 micron per day

6 0
2 years ago
The engine of a 2000kg car has a power rating of 75kW. How long would it take (seconds) to accelerate from rest to 100 km/hr at
Delvig [45]

Answer: 10.29 sec.

Explanation:

Neglecting drag and friction, and at road level , the energy developed during the time the car is accelerating, is equal to the change in kinetic energy.

If the car starts from rest, this means the following:

ΔK = 1/2 m*vf ²

As Power (by definition) is equal to Energy/Time= 75000 W= 75000 N.m/seg, in order to get time in seconds, we need to convert 100 km/h to m/sec first:

100 (Km/h)*( 1000m /1 Km)*(3600 sec/1 h)= 27,78 m/sec

Now, we calculate the change in energy:

ΔK= 1/2*2000 Kg. (27,78)² m²/sec²= 771,728 J

<h2>If P= ΔK/Δt, </h2><h2>Δt= ΔK/P= 771,728 J / 75,000 J/sec= 10.29 sec.</h2>
4 0
3 years ago
Engineers need to be open-ended when dealing with their designs. Why?
melomori [17]
I think the answer would be A if its wrong I’m sorry
7 0
3 years ago
Other questions:
  • Assume that we have a BS with a 6-dB antenna gain and an MS with antenna gain of 2 dB, at heights 10 m and 1.5 m, respectively,
    5·1 answer
  • How to solve this question
    11·1 answer
  • A tank has two rooms separated by a membrane. Room A has 1 kg of air and a volume of 0.5 m3; room B has 0.75 m3 of air with dens
    15·1 answer
  • Which one of the following activities is not exempt from licensure pursuant to Chapter 471, F.S.? A person practicing engineerin
    5·1 answer
  • A preheater involves the use of condensing steam at 100o C on the inside of a bank of tubes to heat air that enters at I atm and
    14·1 answer
  • A plane wall of thickness 2L = 40 mm and thermal conductivity k = 5 W/m K experiences uniform volumetric heat generation at a ra
    15·1 answer
  • Discuss the ethics of the circumstances that resulted in the Columbia shuttle disaster. Considering the predictions that were ma
    5·1 answer
  • (Architecture) Sarah is an environmental activist. She frequently conducts various programs and activities in her community to p
    15·1 answer
  • During delivery of a 2023 ariya equipped with propilot assist 2. 0, what should you point out to your customers about the turn s
    12·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!