in C# i need to  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) Both of these values are computed by calling private methods. Include read-only properties to get a Room’s values. A room is assumed to have four walls, and you do not need to allow for windows and doors, and you do not need to allow for painting the ceiling. A room requires one gallon of paint for every 350 square feet (plus an extra gallon for any square feet greater than 350). In other words, a 12 x 3 x 10 room with 9-foot ceilings has 396 square feet of wall space, and so requires two gallons of paint. the errors are  Room class defined and returns its area 0 out of 1 checks passed. Compilation failed: 6 error(s), 0 warnings NtTestd1b16202.cs(12,5): error CS0246: The type or namespace name `Room' could not be found. Are you missing an assembly reference?  NtTestd1b16202.cs(13,26): error CS0841: A local variable `room1' cannot be used before it is declared NtTestd1b16202.cs(15,5): error CS0246: The type or namespace name `Room' could not be found. Are you missing an assembly reference? NtTestd1b16202.cs(16,26): error CS0841: A local variable `room2' cannot be used before it is declared NtTestd1b16202.cs(18,5): error CS0246: The type or namespace name `Room' could not be found. Are you missing an assembly reference? NtTestd1b16202.cs(19,26): error CS0841: A local variable `room3' cannot be used before it is declared Test Contents [TestFixture] public class RoomClassTest { [Test] public void RoomTest() { Room room1 = new Room(8,8,8); Assert.AreEqual(256, room1.Area); Room room2 = new Room(18,13,10); Assert.AreEqual(620, room2.Area); Room room3 = new Room(22,15,11); Assert.AreEqual(814, room3.Area); } } The Room class calculates and returns the number of gallons required to paint the room 0 out of 1 checks passed.  Unit TestIncomplete The Room class can be initialized and returns the required number of gallons to paint the room Build Status Build Failed   Build Output   Compilation failed: 6 error(s), 0 warnings NtTest667e54f5.cs(12,5): error CS0246: The type or namespace name `Room' could not be found. Are you missing an assembly reference? NtTest667e54f5.cs(13,24): error CS0841: A local variable `room1' cannot be used before it is declared NtTest667e54f5.cs(15,5): error CS0246: The type or namespace name `Room' could not be found. Are you missing an assembly reference? NtTest667e54f5.cs(16,24): error CS0841: A local variable `room2' cannot be used before it is declared NtTest667e54f5.cs(18,5): error CS0246: The type or namespace name `Room' could not be found. Are you missing an assembly reference? NtTest667e54f5.cs(19,24): error CS0841: A local variable `room3' cannot be used before it is declared   Test Contents [TestFixture] public class RoomClassTest { [Test] public void RoomTest() { Room room1 = new Room(8,8,8); Assert.AreEqual(1, room1.Gallons); Room room2 = new Room(18,13,10); Assert.AreEqual(2, room2.Gallons); Room room3 = new Room(22,15,11); Assert.AreEqual(3, room3.Gallons); } } my code so far is  using static System.Console; class PaintintDemo {    static void Main()    {       // Write your main here    } }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

in C# i need to 

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)

Both of these values are computed by calling private methods. Include read-only properties to get a Room’s values.

A room is assumed to have four walls, and you do not need to allow for windows and doors, and you do not need to allow for painting the ceiling. A room requires one gallon of paint for every 350 square feet (plus an extra gallon for any square feet greater than 350). In other words, a 12 x 3 x 10 room with 9-foot ceilings has 396 square feet of wall space, and so requires two gallons of paint.

the errors are 

Room class defined and returns its area

0 out of 1 checks passed.

Compilation failed: 6 error(s), 0 warnings

NtTestd1b16202.cs(12,5): error CS0246: The type or namespace name `Room' could not be found. Are you missing an assembly reference? 

NtTestd1b16202.cs(13,26): error CS0841: A local variable `room1' cannot be used before it is declared

NtTestd1b16202.cs(15,5): error CS0246: The type or namespace name `Room' could not be found. Are you missing an assembly reference?

NtTestd1b16202.cs(16,26): error CS0841: A local variable `room2' cannot be used before it is declared

NtTestd1b16202.cs(18,5): error CS0246: The type or namespace name `Room' could not be found. Are you missing an assembly reference?

NtTestd1b16202.cs(19,26): error CS0841: A local variable `room3' cannot be used before it is declared

Test Contents

[TestFixture]

public class RoomClassTest

{

[Test]

public void RoomTest()

{

Room room1 = new Room(8,8,8);

Assert.AreEqual(256, room1.Area);

Room room2 = new Room(18,13,10);

Assert.AreEqual(620, room2.Area);

Room room3 = new Room(22,15,11);

Assert.AreEqual(814, room3.Area);

}

}

The Room class calculates and returns the number of gallons required to paint the room

0 out of 1 checks passed. 

Unit TestIncomplete

The Room class can be initialized and returns the required number of gallons to paint the room

Build Status
Build Failed
 
Build Output
 
Compilation failed: 6 error(s), 0 warnings
NtTest667e54f5.cs(12,5): error CS0246: The type or namespace name `Room' could not be found. Are you missing an assembly reference?
NtTest667e54f5.cs(13,24): error CS0841: A local variable `room1' cannot be used before it is declared
NtTest667e54f5.cs(15,5): error CS0246: The type or namespace name `Room' could not be found. Are you missing an assembly reference?
NtTest667e54f5.cs(16,24): error CS0841: A local variable `room2' cannot be used before it is declared
NtTest667e54f5.cs(18,5): error CS0246: The type or namespace name `Room' could not be found. Are you missing an assembly reference?
NtTest667e54f5.cs(19,24): error CS0841: A local variable `room3' cannot be used before it is declared
 
Test Contents
[TestFixture]
public class RoomClassTest
{
[Test]
public void RoomTest()
{
Room room1 = new Room(8,8,8);
Assert.AreEqual(1, room1.Gallons);
Room room2 = new Room(18,13,10);
Assert.AreEqual(2, room2.Gallons);
Room room3 = new Room(22,15,11);
Assert.AreEqual(3, room3.Gallons);
}
}
my code so far is 
using static System.Console;
class PaintintDemo
{
   static void Main()
   {
      // Write your main here
   }
}
 
 
 
 
Expert Solution
Step 1

Algorithm steps to solve the given problem:

  1. Start
  2. Define a class 'Room' with the member variables length, width, height, area, and gallons.
  3. Define a constructor for the class 'Room' which takes length, width, and height as parameters.
  4. In the constructor, set the member variables equal to the length, width, and height parameters and call the methods Calculate Area and Calculate Gallons.
  5. Define the method Calculate Area which sets the area member variable equal to 2 multiplied by the height multiplied by the sum of the length and width variables.
  6. Define the method Calculate Gallons which sets the gallons member variable equal to the area divided by 350, and if the remainder is not 0, then add 1 to the gallons member variable.
  7. Define the properties Area and Gallons for the class Room which return the area and gallons member variables, respectively.
  8. In the main method, declare an array of Room objects of size 3.
  9. Create 3 Room objects and pass in the appropriate length, width, and height values to each.
  10. Use a for loop to loop through each Room object in the array and output its area and gallons of paint needed.
  11. Output the result.
  12. Stop.
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education