Question: All these together solve it Question 1 a. Design a class named Employee with the following contents: name - Name of the employee age -

 All these together solve it Question 1 a. Design a class

named Employee with the following contents: name - Name of the employee

All these together solve it

Question 1 a. Design a class named Employee with the following contents: name - Name of the employee age - age of the employee with default value of 20 salary-a double data with default value 300.000 constructor - no arg constructor - with parameters method to display the name, age and salary b. Draw a UML for (1) above and implement the class Employee c. Design a test program to create 2 employee objects. You need to input the name, age and salary for each employee and display them from each object Question 2 a. Design a class named - Triangle - with the following contents: base - a double data indicating the length of the base of the triangle height - a double data indicating the height of the triangle constructor - default with initial values of base = 1.0 and height = 1.0 constructor with parameters two methods - first to find the area of the triangle (getArea() using the equation [area = (1/2) * base * height]) second method to display the base, height and area of the triangle b. Draw a UML for (1) and implement the class Triangle Design a test program to create two triangle objects. You need to input the base and height for each triangle object and display the base, height and area of each object

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!