Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab Exercises Exercise 1-Rhombus Exercise Objectives Class and Object Problem Description Part 1: Declare a java class named Rhombus that has the following members: a.

image text in transcribed

Lab Exercises Exercise 1-Rhombus Exercise Objectives Class and Object Problem Description Part 1: Declare a java class named Rhombus that has the following members: a. Constructor b. Three private members: Diagonal-1, Diagonal-2, and side. C.three member functions: 1. setSides: sets the Diagonal-1 ,Diagonal-2 and side of Rhombus. 2. Area: Computes the area of the Rhombus object. //area=(d1*d2)/2 3. Perimeter: Computes the perimeter of the Rhombus object. //perimeter=4*side Part 2: write a driver Test program that performs the following: 1. Create an object names myRhombus, and an array of objects of type Rhombus. 2. Set myRhombus Diagonal-1 to 5, Diagonal-2 to 7, and side to 6. 3. Compute and print myRhombus's area and perimeter using object name. 4. Set the Diagonal-1, Diagonal-2, and side of the first 4 myRhombus objects of The array, compute and prints their area and perimeter

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

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

=+10. How are inflation and unemployment related in the short run?

Answered: 1 week ago

Question

=+8. Why is productivity important?

Answered: 1 week ago