![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 14.12.2021 01:00 TheCampingStone
Define an interface named Shape with a single method named area that calculates the area of the geometric shape:
public double area();
Next, define a class named Circle that implements Shape. The Circle class should have an instance variable for the radius, a constructor that sets the radius, an accessor and a mutator method for the radius, and an implementation of the area method.
Define another class named Rectangle that implements Shape. The Rectangle class should have instance variables for the height and the width, a constructor that sets the height and the width, accessor/mutator methods for the height and the width, and an implementation of the area method.
The following test code should then output the area of the Circle and Rectangle objects:
public static void main (String[] args) {
Circle c = new Circle(4); //Radius=4
Rectangle r = new Rectangle(4, 3); // Height = 4, Width = 3
ShowArea(c);
ShowArea(r);
}
public static void ShowArea(Shape s) {
double area = s. area();
System. out. println("The area of the shape is " + area);
}
Defining an Inner Class
Rewrite the given classes Employee, HourlyEmployee, so that the class Date is an inner class of the class Employee and an inherited class of the class HourlyEmployee.
Write a program to instantiate at least two objects each of type Employee and HourlyEmployee. Display the hire dates for each employee and then modify and display the hire dates for each of the employees.
![ansver](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 19:20
Write a program that reads a file consisting of studentsβ test scores in the range 0β200. it should then determine the number of students having scores in each of the following ranges: 0β24, 25β49, 50β74, 75β99, 100β124, 125β149, 150β174, and 175β200. output the score ranges and the number of students. (run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, 189.)
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 14:00
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 25.06.2019 08:30
While using pert (program evaluation review technique) and cpm (critical path method) techniques, activities that are not on the critical path are more inflexible than those activities on the critical path. select one: true false
Answers: 1
You know the right answer?
Define an interface named Shape with a single method named area that calculates the area of the geom...
Questions
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 01.07.2019 03:40
![question](/tpl/images/cats/mat.png)
Mathematics, 01.07.2019 03:40
![question](/tpl/images/cats/mat.png)
Mathematics, 01.07.2019 03:40
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 01.07.2019 03:40
![question](/tpl/images/cats/mat.png)
Mathematics, 01.07.2019 03:40
![question](/tpl/images/cats/mat.png)
Mathematics, 01.07.2019 03:40
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 01.07.2019 03:40
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 01.07.2019 03:40
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 01.07.2019 03:40
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
History, 01.07.2019 03:40
![question](/tpl/images/cats/mat.png)
Mathematics, 01.07.2019 03:40
![question](/tpl/images/cats/istoriya.png)
History, 01.07.2019 03:40
![question](/tpl/images/cats/mat.png)
Mathematics, 01.07.2019 03:40
![question](/tpl/images/cats/istoriya.png)
History, 01.07.2019 03:40