Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please type the code in Java and have a screenshot of the output attached. Lab-04-01 The following program Lab4.0 demonstrates structural programming solution to calculate

image text in transcribed

Please type the code in Java and have a screenshot of the output attached.

Lab-04-01 The following program Lab4.0 demonstrates structural programming solution to calculate Rectangle area. This program accept the length and width variables as arguments of method getArea(20,30) and return the area of Rectangle Your job is to write an object oriented program with following definitions: 1. Name the class Rectangle, (look blow the Hint line), public class Rectangle. 2. Add a data member name width of type double private. 3. Add a data member named Length of type double private. Add a void method display(), to print to standard output the fields Length, Width, and area of Rectangle. 5. Demo program to test your program 4. 1. 4. A. 7/Lab4.0 package rectangle; public class Rectangle { public static void main(String[] args) { double area=getArea (20,30); System.out.println(area); } static double getArea (double 1, double w) { return (1*w); } } Hint ---Look at the video clip attached to assignment page public class Rectangle { private double length; private double width; void setProperty (double len, double wed) (...3 lines) double getArea() {...3 lines } public void display() { System.out.println("W="+ width+ "L="+length+" Area="+getArea()); 1 )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago