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]
4 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]4 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
QUESTION
Ymorist [56]
Torch body if I’m wrong I’m really sorry that’s what I got
3 0
3 years ago
The clepsydra, or water clock, was a device that the ancient Egyptians, Greeks, Romans, and Chinese used to measure the passage
Nookie1986 [14]

Suppose a tank is made of glass and has the shape of a right-circular cylinder of radius 1 ft. Assume that h(0) = 2 ft corresponds to water filled to the top of the tank, a hole in the bottom is circular with radius in., g = 32 ft/s2, and c = 0.6. Use the differential equation in Problem 12 to find the height h(t) of the water.

Answer:

Height of the water = √(128)/147456 ft

Explanation:

Given

Radius, r = 1 ft

Height, h = 2 ft

Radius of hole = 1/32in

Acceleration of gravity, g = 32ft/s²

c = 0.6

Area of the hold = πr²

A = π(1/32)² ---- Convert to feet

A = π(1/32 * 1/12)²

A = π/147456 ft²

Area of water = πr²

A = π 1²

A = π

The differential equation is;

dh/dt = -A1/A2 √2gh where A1 = Area of the hole and A2 = Area of water

A1 = π/147456, A2 = π

dh/dt = (π/147456)/π √(2*32*2)

dh/dt = 1/147456 * √128

dh/dt = √128/147456 ft

Height of the water = √(128)/147456 ft

3 0
4 years ago
Create a C language program that can be used to construct any arbitrary Deterministic Finite Automaton corresponding to the FDA
otez555 [7]

Answer:

see the explanation

Explanation:

/* C Program to construct Deterministic Finite Automaton */

#include <stdio.h>

#include <DFA.h>

#include <stdlib.h>

#include <math.h>

#include <string.h>

#include <stdbool.h>

struct node{

struct node *initialStateID0;

struct node *presentStateID1;

};

printf("Please enter the total number of states:");

scanf("%d",&count);

//To create the Deterministic Finite Automata

DFA* create_dfa DFA(){

  q=(struct node *)malloc(sizeof(struct node)*count);

  dfa->initialStateID = -1;

  dfa->presentStateID = -1;

  dfa->totalNumOfStates = 0;

  return dfa;

}

//To make the next transition

void NextTransition(DFA* dfa, char c)

{

  int tID;

  for (tID = 0; tID < pPresentState->numOfTransitions; tID++){

       if (pPresentState->transitions[tID].condition(c))

      {

          dfa->presentStateID = pPresentState->transitions[tID].toStateID;

          return;

      }

  }

  dfa->presentStateID = pPresentState->defaultToStateID;

}

//To Add the state to DFA by using number of states

void State_add (DFA* pDFA, DFAState* newState)

{  

  newState->ID = pDFA->numOfStates;

  pDFA->states[pDFA->numOfStates] = newState;

  pDFA->numOfStates++;

}

void transition_Add (DFA* dfa, int fromStateID, int(*condition)(char), int toStateID)

{

  DFAState* state = dfa->states[fromStateID];

  state->transitions[state->numOfTransitions].toStateID = toStateID;

  state->numOfTransitions++;

}

void reset(DFA* dfa)

{

  dfa->presentStateID = dfa->initialStateID;

}

5 0
4 years ago
(2 points) A perfectly mixed aeration pond with no recycle serves as the biological reactor for a small community. The pond rece
FromTheMoon [43]

Answer:

a)  t = 165 days

b) 9.9 kg/day

Explanation:

Given data:

final lelvel of BOD is 20 mg/l

Ks = 100 mg BOD/L,

kd = 0.10 day-1 ,

μm = 1.6 day-1 ,

Y = 0.60 mg SS/mg BOD

a) we know that

c_{out} = \frac{c_{in}}{1 + kt}

20 = \frac{350}{1 + 0.1 t}

solving for t

t  =  165 days

b) mass of microbes = Q(mlD) × C(mg/l)

= 30\times 10^{-3} (350-20) = 9.9 kg/day

3 0
3 years ago
I NEED HELP NOW!!!!!!!!!!!!!!
Greeley [361]

Answer:

S or the 4th option

Explanation:

THIS IS SO EASY

8 0
3 years ago
Read 2 more answers
Other questions:
  • A paper clip is made of wire 0.75 mm in diameter. If the original material from which the wire is made is a rod 25 mm in diamete
    6·1 answer
  • What are pneumatic tools powered by?
    9·1 answer
  • g A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number of steps, and whose output
    10·2 answers
  • A ceramic material can be defined as an organic compound consisting of a metal or semimetal and one or more nonmetals: (a) true
    9·1 answer
  • explain the four functional blocks on an oscilloscope and describe the major controls within each block
    6·1 answer
  • Q.17) A 50-acre catchment containing cropland is converted ot a Qatar mail
    13·1 answer
  • Hot engine oil with heat capacity rate of 4440 w/k (product of mass flow rate and specific heat) and an inlet temperature of 150
    13·1 answer
  • A glass plate is subjected to a tensile stress of 40 MPa. If the specific surface energy is 0.3 J/m2 and the modulus of elastici
    14·1 answer
  • Pls answer and I will give a like!
    8·1 answer
  • Which step in the engineering design process does not come before building a<br> prototype?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!