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
Which of the following refers to software designed to alter system files and utilities on a victim’s system with the intention o
Oksi-84 [34.3K]
The answer is Rootkits.
6 0
2 years ago
When moving cylinders always remove and make
Karolina [17]

Unless cylinders are firmly secured on a special carrier intended for this purpose, regulators shall be removed and valve protection caps put in place before cylinders are moved. A suitable cylinder truck, chain, or other steadying device shall be used to keep cylinders from being knocked over while in use.

5 0
3 years ago
1. A glass window of width W = 1 m and height H = 2 m is 5 mm thick and has a thermal conductivity of kg = 1.4 W/m*K. If the inn
emmasim [6.3K]

Answer:

1. \dot Q=19600\ W

2. \dot Q=120\ W

Explanation:

1.

Given:

  • height of the window pane, h=2\ m
  • width of the window pane, w=1\ m
  • thickness of the pane, t=5\ mm= 0.005\ m
  • thermal conductivity of the glass pane, k_g=1.4\ W.m^{-1}.K^{-1}
  • temperature of the inner surface, T_i=15^{\circ}C
  • temperature of the outer surface, T_o=-20^{\circ}C

<u>According to the Fourier's law the rate of heat transfer is given as:</u>

\dot Q=k_g.A.\frac{dT}{dx}

here:

A = area through which the heat transfer occurs = 2\times 1=2\ m^2

dT = temperature difference across the thickness of the surface = 35^{\circ}C

dx = t = thickness normal to the surface = 0.005\ m

\dot Q=1.4\times 2\times \frac{35}{0.005}

\dot Q=19600\ W

2.

  • air spacing between two glass panes, dx=0.01\ m
  • area of each glass pane, A=2\times 1=2\ m^2
  • thermal conductivity of air, k_a=0.024\ W.m^{-1}.K^{-1}
  • temperature difference between the surfaces, dT=25^{\circ}C

<u>Assuming layered transfer of heat through the air and the air between the glasses is always still:</u>

\dot Q=k_a.A.\frac{dT}{dx}

\dot Q=0.024\times 2\times \frac{25}{0.01}

\dot Q=120\ W

5 0
3 years ago
Not sure which one....
Airida [17]
I think downwards as that's how most saw's work.
4 0
2 years ago
A right triangle has a base of 12 inches and a height of 30 inches, what is the centroid of the triangle?​
aliina [53]

Answer:

the correct answer is 42

4 0
2 years ago
Other questions:
  • The Fibonacci sequence 1, 1, 2, 3, 5, 8, 13, 21…… starts with two 1s, and each term afterward is the sum of its two predecessors
    8·2 answers
  • Consider a system with two tasks, Task1 and Task2. Task1 has a period of 200 ms, and Task2 has a period of 300 ms. All tasks ini
    5·1 answer
  • Technician A says a basic circuit problem can be caused by something in the circuit that increases voltage. Technician B says a
    8·1 answer
  • Design a stepped-impedance low-pass filter having a cutoff frequency of 3 GHz and a fifth-order 0.5 dB equal-ripple response. As
    9·1 answer
  • Heat in the amount of 100 kJ is transferred directly from a hot reservoir at 1200 K to a cold reservoir at 600 K. Calculate the
    15·1 answer
  • A three-phase voltage source with a terminal voltage of 22kV is connected to a three-phase transformer rated 5MVA 22kV/220V. The
    8·1 answer
  • Mobility refers to the ability to?
    12·1 answer
  • The ultimate BOD of a river just below a sewage outfall is 50.0 mg/L, and the oxygen deficit at the outfall D0 is 2.0 mg/L. The
    6·1 answer
  • A lightbulb has a fixed negative and positive connector. You cannot swap positive and negative sides of a lightbulb in a circuit
    9·2 answers
  • Work to be performed can come from the work package level of the work breakdown structure as well as other sources. Which of the
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!