Answered step by step
Verified Expert Solution
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.
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started