Create the default junit tests using netbeans

Assignment Help JAVA Programming
Reference no: EM131043924

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.

Reference no: EM131043924

Questions Cloud

Borrow money by issuing perpetual bonds with coupon rate : Illinois Industries has decided to borrow money by issuing perpetual bonds with a coupon rate of 9.5 percent, payable annually. The one-year interest rate is 9.5 percent. What will the market value of these bonds be if they are noncallable?
Forward contract price and the futures price : A futures contract expiring in April on Mexican pesos is avail­able now for $.08 per unit. Also, a forward contracts is available for the same settlement date at a price of $.085 per peso. How could speculators capitalize on this situation, assuming ..
Cashless collar with a financial institution : A company enters into a cashless collar with a financial institution: How much will the company receive from the financial institution upon physical settlement of natural gas for the month of March 2016?
About the individual retirement account : Bill plans to fund his individual retirement account (IRA) with the equal amount contribution at the end of year for the next 20 years. If Bill can earn 12 percent on his contributions and he wants to accumulate $1,000,000 at the end of twentieth yea..
Create the default junit tests using netbeans : Create the 'default' JUnit tests using NetBeans. Do this for the HomeAppliance class only; not for your JFrame GUI class.
Equity based compensation plan : Equity Based Compensation Plan Please create an equity based compensation plan for your fictitious company and explain why this can be the most powerful device available for a company.
Products exported by the sports exports company : SMALL BUSINESS DILEMMA Ensuring Payment for Products Exported by the Sports Exports CompanyThe Sports Exports Company produces footballs and exports them to a distributor in the United Kingdom.
Calculate the aftertax cash flows for first year for bond : Suppose your company needs to raise $45 million and you want to issue 30-year bonds for this purpose. Assume the required return on your bond issue will be 6 percent, and you’re evaluating two issue alternatives: Calculate the aftertax cash flows for..
Question regarding the long-term incentives : Please provide an example how long term incentive plans have helped a company meet their strategic goals. Explain whether or not you believe most long term incentives are attainable.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java socket hello i need to this assignment done in net

hello i need to this assignment done in net beans . and i want comment in code .also screen shots of running program

  Create a messageframe class extending jframe

Create a MessageFrame class extending JFrame and a MessagePanel class extending JPanel.

  Explore the issues involved in developing applications

Explore the issues involved in developing applications for mobile, location aware, networked devices, including IICI, commercial, security, hardware, and development process issues.

  Adopting a working game of ping pong in java

Create a new Java project. You will be porting each of the classes from the example code to swing, so its better to code in empty class and fill in the details - Object-Oriented Design in Java

  Create a jsp that displays the student name

Create a JSP that displays the student name and the current score, given the EMPLID and class ID. For each class, a text file is used to store the student name, EMPLID, and current score

  Integer elements from an array

Suppose this same system has a TLB (Translation Lookaside Buffer) with 32 entries. Furthermore, suppose that a program contains instructions that fit into one page and it sequentially reads long integer elements from an array that spans thou- sand..

  Java assignment

Java Assignment

  Write client code to call the print method of counter.

Write client code to deposit 7 quarters, 3 dimes, 10 nickels, and 17 pennies in counter. Output the new status of counter using the toString method.

  Validation and event handling in javascrip

To complete this project you will write and submit one HTML file containing embedded CSS and JavaScript. The file will be called lab2.html. This file contains a registration form, which can be styled any way you like subject to the requirements be..

  Design and implement an applet called circles

Design and implement an applet called Circles that draws 50 circles of random diameter in random locations. If the diameter of a circle is less than a certain value, the circle is ?lled with the color yellow.

  Develop a reliable transfer protocol over udp

Develop a reliable transfer protocol over UDP. Focus on a Stop- and-Wait protocol.

  Write a program that evaluates the day of the week for new

write a program that evaluates the day of the week for new years day in the year 3000. to do this you must create your

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd