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
Identify the measurement shown in figure 7 and state in centimeters ​
Sav [38]

Answer:

1.3cm

Explanation:

the arrow is 3 lines past the 1 so it is 1.3cm

6 0
3 years ago
Fluorescent troffers are a type of _ lighting fixture
creativ13 [48]
The answer would be letter A
8 0
2 years ago
A 20.0 µF capacitor is charged to a potential difference of 800 V. The terminals of the charged capacitor are then connected to
Sergeu [11.5K]

Answer:

a) Q_initial = 16 * 10^-3 C

b) V_1 = V_2 =  (16/3) * 10^2 V

c)  E = 64/15 J

d)  dE = 32/15 J of decrease

Explanation:

Given:

- Capacitor 1, C_1 = 20.0 uF

- Capacitor 2, C_2 = 10.0 uF

- Charged with P.d V = 800 V

Find:

a) the original charge of the system,

(b) the final potential difference across each capacitor

(c) the final energy of the system

(d) the decrease in energy when the capacitors are connected.

Solution:

a)

- The initial charge in the circuit is the one carried by the first charged capacitor.

                           Q_initial = C_1*V

                           Q_initial = 20*10^-6 * 800

                           Q_initial = 16 * 10^-3 C

b)

- After charging the other capacitor, we know that the total charge is conserved among two capacitor:

                          Q_initial = Q_1 + Q_2

- We also know that potential difference across two capacitor is also same.

                          V_1 = V_2 = Q_1 / C_1 = Q_2 / C_2

- Using the two equations and solve for charge Q_2:

                          Q_2 = Q_1*C_2/C_1

                          Q_2 = Q_1*10/20 = 0.5*Q_1

- using conservation of charge:

                          Q_initial = 1.5*Q_1

                          Q_1 = 16*10^-3 / 1.5 = 10.67*10^-3 C

- Hence the Voltage across each capacitor is:

                          V_2 = V_1 = Q_1 / C_1  

                                            = 10.67*10^-3 / 20*10^-6

                                            = (16/3) * 10^2 V

c)

- The energy in the system is:

                          E = 0.5*C_eq*V^2

Where, C_eq is the equivalent capacitance of paralle circuit.

                           E = 0.5*(20+10)*10^-6 *((16/3) * 10^2)^2

                          E = 64/15 J

d)

- The decrease in energy of the capacitors is:

                           dE = E_initial - E_final

Where, E_initial is due to charging of the C_1 only:

                          dE = 0.5*10^-6*20*800^2 - (64/15)

                          dE = 32/5 - 64/15 = 32/15 J

5 0
3 years ago
How to get on your screen on 2k20 in every mode
VashaNatasha [74]
D pad or rb or lb hop this helps
5 0
2 years ago
Read 2 more answers
A hypothetical A-B alloy of composition 57 wt% B-43 wt% A at some temperature is found to consist of mass fractions of 0.5 for b
Dennis_Churaev [7]

Answer:

composition of alpha phase is 27% B

Explanation:

given data

mass fractions  = 0.5 for both

composition = 57 wt% B-43 wt% A

composition = 87 wt% B-13 wt% A

solution

as by total composition Co = 57 and by beta phase composition  Cβ = 87  

we use here lever rule that is

Wα = Wβ   ...............1

Wα = Wβ = 0.5

now we take here left side of equation

we will get

\frac{C_\beta - Co}{C_\beta - Ca}   = 0.5

\frac{87 - 57}{87 - Ca} = 0.5  

solve it we get

Ca = 27

so composition of alpha phase is 27% B

8 0
3 years ago
Other questions:
  • Which of the following are all desirable properties of a hydraulic fluid? a. good heat transfer capability, low viscosity, high
    5·1 answer
  • A __ insulated panel consists of a layer of insulating foam between two osb or plywood panels
    14·2 answers
  • Which of the following should NOT be included in an emergency kit?
    13·2 answers
  • A consultant has proposed that a pulse-jet baghouse with bags that are 15 cm in diameter and 5 m in length. Estimate the net num
    15·1 answer
  • If the electric field just outside a thin conducting sheet is equal to 1.5 N/C, determine the surface charge density on the cond
    9·1 answer
  • What is the ILS stand for
    8·2 answers
  • A four-lane freeway (two lanes in each direction) is located on rolling terrain and has 12-ft lanes, no lateral obstructions wit
    14·1 answer
  • What was the most important thing you learned this school year in your engineering class and why did you choose this thing
    15·1 answer
  • Mang Tisoy bought two bags of onion from the market. One bag weighed 8 kg
    14·1 answer
  • What is the creative process that helps you overcome writer's block called?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!