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
cThe Mars Rover Spirit got stuck in the Martian sand. The wheels kept slipping. Attempts to free it were futile. Discuss the typ
IgorC [24]

Answer:

Improved/ advanced types of Actuators include servo systems, create a large range of actuator motion in response to the changing needs of the operational environment or process.

Actuators are local or automated suppliers of working motion.

Hydraulic and air cylinders can be classified as single-acting cylinders, meaning that the energy source result in movement in one direction and a spring is used for the other direction.

Explanation:

An actuator control system is referred to as any electronic, electrical, or electromechanical system often used to activate an actuator, control the direction as well as extent and duration of its output. Actuator control systems could take the form of extremely simple, manually-operated, start-and-stop stations, either sophisticated or programmable computer systems. The more improved/ advanced types include servo systems that produce a large range of actuator motion in response to the changing needs of the operational environment or process. This type of actuator control system uses an interface arrangement that assimilates feedback from the process or mechanism and adjusts the actuator in the right way. Most actuator systems will include at least a set of travel limits that prevent the actuator destroying itself or the secondary mechanism.

Actuators are local or automated suppliers of working motion. They are used to changes, adjust, or move a secondary mechanism, where a physical operator cannot intervene directly. They are denoted by a large range of varying types using electrical and electromagnetic, hydraulic, or pneumatic power sources to create linear or rotary outputs. One element they all have in common is the actuator control system used to start, stop, and adjust the range, speed, and duration of the working motion.

Actuators can produce a linear motion, rotary motion or oscillatory motion which means they can create motion in one direction, in a circular motion or in opposite directions at regular intervals. Hydraulic and air cylinders can be classified as single-acting cylinders, meaning that the energy source result in movement in one direction and a spring is used for the other direction.

7 0
3 years ago
A rod that was originally 100-cm-long experiences a strain of 82%. What is the new length of the rod?
lisabon 2012 [21]

Answer:

The new length of the rod is 182 cm.

Explanation:

Given that a rod that was originally 100-cm-long experiences a strain of 82%, to determine what is the new length of the rod, the following calculation must be performed:

100 x 1.82 = X

182 = X

 

Therefore, the new length of the rod is 182 cm.

7 0
3 years ago
How do you keep the weight evenly distributed on a trailered boat?
Neporo4naja [7]
C because i know what i’m taking about
7 0
3 years ago
Steep safety ramps are built beside mountain highway to enable vehichles with fedective brakes to stop safely. a truck enters a
Veronika [31]

Answer:

a. 6 seconds

b. 180 feet

Explanation:

Images attached to show working.

a. You have the position of the truck so you integrate twice. Use the formula and plug in the time t = 7 sec. Check out uniform acceleration. The time at which the truck's velocity is zero  is when it stops.

b. Determine the initial speed. Plug in the time calculated in the previous step. From this we can observe that the truck comes to a stop before the end of the ramp.

7 0
3 years ago
Timescale limits knowledge for scientists because it is difficult for them to see much beyond their lifetimes. Question 1 option
vaieri [72.5K]

Answer:

I think true

Explanation:

Well I mean...we cant see the future. Certain things will be achieveable in different ganerations like going on mars

8 0
2 years ago
Other questions:
  • A 10-kg block A is released from rest 2 m above the 5-kg plate P, which can slide freely along the smooth vertical guides BC and
    6·1 answer
  • Water at a pressure of 3 bars enters a short horizontal convergent channel at 3.5 m/s. The upstream and downstream diameters of
    10·1 answer
  • The boiler pressure is 38bar and the condenser pressure 0.032 bar.The saturated steam is superheated to 420 oC before entering t
    8·1 answer
  • For the R function shown below(Attachment):
    5·1 answer
  • A wall in a house contains a single window. The window consists of a single pane of glass whose area is 0.15 m2 and whose thickn
    10·1 answer
  • A 3-phase induction motor is being driven at a frequency of 80 Hz, and the motor speed is 1000 rpm. How many poles does the moto
    8·1 answer
  • What is the following diagram called?
    15·1 answer
  • What is electrical energy used for?
    8·2 answers
  • You have a 12 volt power source running through a circuit that has 3kΩ of resistance, how many amps (in mA) can flow through the
    15·1 answer
  • The solid rod BC has a diameter of 30 mm and is made of an aluminum for which the allowable shearing stress is 25 MPa. Rod AB is
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!