JAVA ASSIGNMENT
Part I
This requires the use of NetBeans 8.1 and written in JAVA
The program should be called the HomeUtilityAuditingProject
1. There should be 3 files:
· 1 would be for the validation call it GUIValidator
· 1 would be the GUI (Swing GUI Form /JFrame Form) call it HomeApplianceFormMain
· 1 would be HomeAppliance
2. GUI Design
· The header label should be: Home Appliance Usage & Cost
· The first field should be Cost per Kilowatt Hour
· The second field should be Appliances
o For Part 1 I only need 1 appliance for Part 2 I need 5 to 7
· The third field should be Power Usage (Watts)
· The fourth field should be Hours Used Per Day
· There should be an error field under each of the fields that shows validation errors in red.
· There should be a Total Cost field which adds each daily total in the column, however this should be above the column
· There should be a Calculate Usage Cost Button and a Clear Button
o The calculate Usage Button should fill in the output area which would be:
Appliance Power Usage (Watts) Hours Used Per Day Daily Cost
Dryer 1100.0 8.5 $33.33
dailyCost=(Cost Per Kilowatt Hour*Power Usage in Watts*Hours Used Per Day/1000)
I would prefer this to be in a table if possible.
· The Clear Button would clear any data in the user input area.
· There should be a Clear All and an Exit Button, the Clear All Button should clear the user input area and the output area and the exit button should exit the GUI
3. Validator
Cost Per Kiolwatt Hour
cannot be blank
must be numbers
must be greater than 0 and less than 10,000
must be in a dollar format
Appliance
cannot be blank
Power Usage (Watts)
cannot be blank
must be numbers
must be greater than 0 and less than 10,000
must be in a 0.0 format
Hours User Per Day
cannot be blank
must be numbers
must be greater than 0 and it cannot be greater than 24 (less than 25)
must be in a 0.0 format
Part II
Update your program from last week. The user should be able to do the following:
Choose from a list of several appliances (not just one). I would prefer an array
Once an appliance is selected, the program will fill in the various input boxes with data filled in previously. By 'previously' I don't mean a previous running of the program. Rather, I mean in the same running of the program. So a user could choose the 'fan' appliance the first time, and all the input values would be blank (or 0). The user would enter data for the fan, then press the 'Update Appliance' button (or whatever your program takes as a signal to enter the data). The appliance values would be validated, and if valid, the fan would be entered into the list area. The user then chooses a different appliance, enters data and presses 'Update Appliance'. The data for that appliance gets handled. Then, if the user chooses the 'fan' again, the program would read the previously entered data for the fan and enter them into the various input boxes. The user could change them and press 'Update Appliance', and the app would update the values, recalculate the cost, and update the list area.
When the user chooses an appliance for the first time, make sure your program 'blanks out' or 'zeroes out' the input fields, because the user has never entered data for that appliance. This is an issue after the user has entered data for an appliance and then chooses a new appliance. If you're not careful, then the values for the previous appliance are still in the input fields for the new appliance.
PART III JTEST
Technical requirements:
Start with a working HomeAppliance class that implements set/get. It doesn't have to be perfect, but it has to have no syntax errors, and it must have get/set methods.
You are not allowed to modify your class. Use whatever you submitted in Part II.
Create the 'default' JUnit tests using NetBeans. Do this for the HomeAppliance class only; not for your JFrame GUI class.
Modify the 'set' tests so that you're setting your HomeAppliance instance fields to something other than 0.0. You should test for 0.0, but make sure you test for more values than just 0.0.
Run the tests. The purpose is NOT, repeat not, to show all the tests passing. Rather, the purpose is to write tests that fail if there are problems with the code being tested, and pass if there are no problems with the code being tested.
Screen capture your NetBeans window, showing the test source and the "Test Results" pane.
Submit the screen capture as well as your zipped project, as usual.