Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Create a superclass named Appliance which has 2 private attributes; location

ID: 3814768 • Letter: 1

Question

1. Create a superclass named Appliance which has 2 private attributes; location which is a
String and value which is a double
2. Create 2 constructors one with no arguments and the other with the 2 attributes as
arguments
3. Override the object method called toString() which will return the string of the location.
Example: “This is located in the bedroom.”
4. Create a class named TV which extends the superclass of Appliance.
5. The subclass TV has 4 additional private attributes; status which is a boolean , size,
channel and volume which are integers.

Explanation / Answer

class Manager extends Employee
{
private String department;
public Manager(String name,int age,double salary,String department)
{
super(name,age,salary);
this.department=department;
}
public String getDetails()
{
return super.details;
}
public void details(String name, int age, double salary, String department)
{
super(name, age, salary);
this.department = department;
}
}