Question: Create a class called Appliance that includes four instance variablestype, brand, model number, and price. Write the code according to our Java coding standardsa constructor

Create a class called Appliance that includes four instance variablestype, brand, model number, and price. Write the code according to our Java coding standardsa constructor that initializes the four instance variables, a default constructor, a get/set for each variable, and toString.

Write a test case, ApplianceTest, that creates two Appliance objects with the following data.

washer, Kenmore, 102956, $299.99

stove, GE, 8956, $575.75

Then, ask the user their name and how many washers were purchased and how many stoves were purchased. This will be repeated for an unknown number of customers. (sentinel while loop) Enter blah blah to quit...

When finished, print the total of each in the format:

Customer: nameofcustomerhere1

X Kenmore washers were purchased for a total of $xxx.xx.

X GE stoves were purchased for a total of $xxx.xx.

Customer: nameofcustomerhere2

X Kenmore washers were purchased for a total of $xxx.xx.

X GE stoves were purchased for a total of $xxx.xx.

The grand total is $xxx.xx

Use JOptionPane for input and output. There will be only one output dialog box.

What I have done so far...

Create a class called Appliance that includes four instance variablestype, brand, modelnumber, and price. Write the code according to our Java coding standardsa

public class Appliance private String type private String brand; private String modelNumber; private double price; public Appliance (String type, String brand, String mode LNumber, double price) this . type = type; this.brand- brand; this.mode LNumber-modeLNumber; this.price- price; public Appliance) type = ""; brand- "; mode Number="" ; price= 0; public String getType() return type; public String getBrand () return brand; public double getPrice() return price; public String getMode LNumber() return modelNumber

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!