on JAVA language      Define a class named Wall. The class should have two private double variables, one to store the length of the Wall and another to store the height . _Create a default constructor that sets the length& height to 0, create a second constructor with input parameters for the of the data variables and third copy constructor. Add accessor and mutator functions to read and set both variables Add another function that returns the area of the Wall as double . Write program that tests all your constructors and functions for at least three different Wall objects

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 2CP
icon
Related questions
Question

on JAVA language 

 

 

Define a class named Wall. The class should have two private double variables, one to store the length of the Wall and another to store the height .
_Create a
default constructor that sets the length& height to 0, create a second constructor with input parameters for the of the data variables and third copy constructor.
Add accessor and mutator functions to read and set both variables Add another function that returns the area of the Wall as double .
Write program that tests all your constructors and functions for at least three different Wall objects

Expert Solution
Step 1

As per the requirement program is developed.

Algorithm:

Step 1: Define the required variables

Step 2: Define default constructor, parameterized constructor and copy constructor

Step 3:  Write the accessor and mutator functions

Step 4: wallArea method return the area of the wall in double value

Step 5: Write the main method

Step 6: Create the objects using three different constructor

Step 7: Print the values accordingly

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Unreferenced Objects
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning