A constructor that allows the make and purchase price to be initialized.price.
CMIS 242 PROJECT 2 COMPUTES THE SALES TAX: The second programming project involves writing a program that computes the sales tax for a collection of automobiles of different types. This program consists of four classes. The first class is the Automobile class, which contains the automobile’s make and model, and purchase price, which is specified in whole dollars. It should have three methods:
CMIS 242 PROJECT 2 COMPUTES THE SALES TAX: The Automobile class has two subclasses. The first is Electric. It has an additional instance variable that contains its weight in pounds stored as an integer. It should have the same three methods:
CMIS 242 PROJECT 2 COMPUTES THE SALES TAX: The second subclass is Hybrid. It has an additional instance variable that contains the number of miles per gallon stored as an integer. It should have the same three methods:
No additional public methods should be included in any of the above three classes.
CMIS 242 PROJECT 2 COMPUTES THE SALES TAX: Finally there should be a fourth class named Project2 that contains the main method. It should generate the GUI shown below:
Image transcription textAutomobile Sales Tax Calculator X Make and Model Sales Price Automobile Type Hybrid Miles per Gallon Electric
Weight in Pounds Other Compute Sales Tax Clear Fields Display Report
After entering the information about the make and model, its sales price and the type of the automobile, clicking the Compute Sales Tax button should display the sales tax in the text field to its right. In addition, the object should be stored in an array of type Automobile. That array should allow space for up to the last five automobiles entered.
If non integer values are entering in any of the fields that require integers, an error message should be displayed in a JOptionPane window.
Clicking the Clear Fields button should clear all text fields.
Clicking the Display Report button should produce a report on the console that includes the information about all the automobiles currently stored in the array. An example of the report that should be displayed is shown below:
Make and Model: Toyota Prius Sales Price: 30000
Sales Tax: 1390.00
Hybrid Vehicle
MPG: 45
Make and Model: Ford Fusion Sales Price: 21000
Sales Tax: 1050.00
CMIS 242 PROJECT 2 COMPUTES THE SALES TAX Be sure to follow good programming style, which means making all instance variables private, naming all constants and avoiding the duplication of code. Furthermore you must select enough different kinds of automobiles to completely test the program
Other Related tasks
CMIS 242 Entire Course includes:
CMIS242 Project 1 Minimum Maximum and Average,
CMIS242 Project 2 Computes the Sales Tax,
CMIS242 Project 3 Draws Two Types of Shapes,
CMIS242 Project 4 Manage a Real Estate Database,