lab6
BCIS 5390 Lab 06 Problem Statement
An Internet service provider has three different subscription packages for its customers:
Package A: For $9.95 per month 10 hours are provided. Additional hours are $2.00 per hour.
Package B: For $13.95 per month 20 hours are provided. Additional hours are $1.00 per hour.
Package C: For $19.95 per month unlimited access is provided
Due to increases in delivery of service to certain markets the Internet service provider is adding a surcharge based upon the customer’s zip code. If the first digit of the zip code is ‘3’ then the additional surcharge is $1.50. If the first digit of the zip code is ‘5’ then the additional surcharge is $1.75. Finally, if the first digit of the zip code is ‘8’ then the additional surcharge is $1.95. See notes below for helpful comments for completing this requirement:
Currently the Internet Service Provider is providing a discount for customers in specific counties. Customers in Comanche county receive a 5% discount, Parker county customers receive a 10% discount, and customers in Erath county receive a 20% discount. The discount amount is applied to the total charge.
Customers can also add any combination of the following options:
High‐speed connection for an additional $30.00 Warranty on equipment for an additional $25.00 24‐hour technical support for an additional $50.00
Write a GUI application (either by writing the Java code for the GUI interface OR by using the built‐in tools in NetBeans to create the GUI) program that calculates a customer’s monthly bill. A sample interface is provided below (you may design the GUI as you see fit as long as it contains all the required components):
General Comments:
A single file can be used. It is NOT necessary to implement methods or a separate class. Data validation is NOT required. Assume ALL data will be valid. Code written for previously submitted lab assignments or posted solution sets CAN be used.
Description of GUI components:
Labels are used to describe each component and provide prompts to the user TextFields are used for to input the hours used and zip code Read‐Only TextFields are used to display all output (the background property has been changed to
distinguish input and output TextFields)
List for the counties (only one county can be selected at any given time) Radio button for packages (placed in a Button Group with Package A selected as the default) Check boxes for options (none, all, or any combination of check boxes can be selected) Buttons for Calculate, Clear, and Exit
Functionality of Buttons:
Calculate button – should process the input from the hours used and zip code TextFields and evaluate the county list, package radio buttons, and options check boxes to produce the required output on the form. Mnemonic should be set to C.
Determine and display base charge and additional charge on package selected from radio buttons Determine and display surcharge based upon zip code Determine and display options amount based upon check boxes selected Calculate and display subtotal, discount amount, total charge Calculate and display the amount of money Package A customers would save if they purchased Package B
or C, and the amount of money Package B customers would save if they purchased Package C.
Implement a counter which tracks the number of times the program executes which represents the number of customers and display the result in the output (hint: see section “Running Totals and Sentinel Values on pgs. 220‐225 [5th ed.] or pgs. 216‐219 [6th ed.])
Implement an accumulator which calculates a running total for discount amount and display the result in the output (hint: see section “Running Totals and Sentinel Values on pgs. 220‐225 [5th ed.] or pgs. 216‐219 [6th ed.])
Implement an accumulator which calculates a running total for total charge and display the result in the output (hint: see section “Running Totals and Sentinel Values on pgs. 220‐225 [5th ed.] or pgs. 216‐219 [6th ed.])
Calculate the average discount amount as running total of discount divided by number of customers and display it in the output
Calculate the average of total charge as running total of total charge and display it in the output
Clear button – should clear ALL the TextFields, the List, set the Package A as the selected radio button, and deselect any check boxes that have been selected. Mnemonic should be set to l (lowercase L)
Exit button – should exit the program. Mnemonic should be set to x
Other Requirements:
Named constants should be used for the cost of each subscription package as well as the additional options so that they can easily be updated if they change in the future. Please follow the naming convention provided in the textbook under Section 2.8, pgs. 69‐70 [both editions].
All monetary output should be formatted the DecimalFormat class or Sting.format() method to display as currency (i.e., leading dollar sign, appropriate comma(s), and two‐decimal places).