Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Programming Assignment 2 –Smart Home continued. You may have noticed that the Smart Home application we built in the last assignment was a little clumsy to implement. If we keep adding new devices,...

1 answer below »

Programming Assignment 2 –Smart Home continued.

You may have noticed that the Smart Home application we built in the last assignment was a little clumsy to implement. If we keep adding new devices, variables will be harder to track, and settings will be harder to manage. You may also notice that certain parts of the Smart Home could be grouped into different categories (for example, both the Music and Television devices shared audio settings).We could make our program more efficient and capable of growth by using inheritance. Object-oriented design to the rescue! Here are your program requirements for your revised Smart Home:

•Create a parent class called “Device.” This should have methods and variables to access and change the power status and the room they are located in

•Create Child Classes called “Entertainment,” “Appliance,” “Security,” and “Light. ”These should all inherit from “Device”

•Create Child Classes that inherit from “Entertainment” that include “Music” and “Television”

•Create Child Classes that inherit from “Appliance” that include “HVAC,” “Oven,” and “Refrigerator”

•Create Child Classes that inherit from “Security” that include “Motion Sensor” and “Camera”

•Each class should have constructors and member variables. Keep variables private; only allow methods to access them

•Populate each class with relevant functionality (you can use Assignment 1 for some insight). Be sure to locate methods in the appropriate hierarchy. If functionality is common across all “Entertainment” devices (such as “change Volume()”), then put that in the “Entertainment” class. If something is unique to “Television,” then put it in that class

•Instantiate at least one instance of the following in your main program: Light, Music, Television, HVAC, Oven, Refrigerator, Motion Sensor, and Camera. This should be in a new file called “SmartHome2.java”

•As with the previous assignment, allow users the ability to input specific commands. You should have at least 12 distinct commands of your choosing; however, one of them should be “Help.” When the user types “Help,” have the system print out all commands for reference. Each command (except for “Help”) should control one or more Smart Home devices. Include appropriate comments throughout your code. Remember to use standard Java naming conventions. Put your name and information about the program at the beginning of your program. Submit your SmartHome2.java, all other Class and Java files in your project, and a screen shot of it in operation on your computer. Package all of these in a zip file and name the submission in the format:NAME_COURSE_ASSIGNMENT_DATE.zip

For all assignments and exercises, submissions should be done as a packaged zip file that contains the following: all .java and .class files from your project and a screenshot of the code operating on your computer. You can save this image as a .jpg or .png. Name the zip file submission in the format:
NAME_COURSE_ASSIGNMENT_DATE.zip

Answered 2 days After Sep 07, 2021

Solution

Kshitij answered on Sep 09 2021
137 Votes
sep_08_21/Appliance.java
sep_08_21/Appliance.java
*   Created by IntelliJ IDEA.
 *   Author: Kshitij Varshney (kshitijvarshne1)
 *   Date: 09-Sep-21
 *   Time: 3:25 AM
 *   File: Appliance.java
 *
package September.sep_08_21;
public class Appliance extends Device {
    public String hvacStatus;
    public boolean ovenStatus;
    public boolean refrigeratorStatus;
    public Appliance() {
        this.hvacStatus = "cool";
        this.ovenStatus = false;
        this.refrigeratorStatus = false;
    }
}
sep_08_21/Channels.txt
ABC
CBS
The CW
ESPN...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here