ISP-Wires

CS 139 Algorithm Development
PA3: ISP Charges

Part A Due in Canvas by Friday, Mar 20 at 11:59PM

Part B Due in WebCAT by Tuesday, Mar 24 at 11:59 PM

Late assignments will be accepted in accordance with the following penalties:

  • -10% on Wednesday Mar 25
  • -20% on Thursday Mar 26
  • -30% on Friday Mar 27
  • -40% on Sunday Mar 29
  • -50% on Monday Mar 30
  • Not accepted afterwards
Part C due in Canvas by Wednesday Mar 26 or one day after you have successfully submitted to WebCAT whichever is later.

 

UPDATES:

  1. If a pagage does not need additional hours (C) then you should not print the additional hours line. See the clarification in red below. (03/17/2015)
  2. Correction to the spacing the the package C example.(3/22/2015)
  3. To insure consistency, display hours with a single digit to the right of the decimal place (3/22/2015)
  4. Changed (see red) to make all examples consistent with the webcat solution. (3/23/2015)

Objectives - At the conclusion of this assignment students will have demonstrated that they can:

Background

This PA is based on Programming Challenge 13 and 14 in your text. "An internet service provide has three different subscription packages for its customers.

Package A: For $9.95 / month: 10 hours of access are provided. Additional hours are: $2.00 / hr.

Package B: For $13.95 / month: 20 hours of access are provided. Additional hours are: $1.00 / hr.

Package C: For $19.95 / month: unlimited access is provided. "

Your job is to read in the hours and the package code and produce a statement for the charges. In addition, if a higher base fee package will save the customer money, you should print a statement to that effect showing the savings. If there are no savings, or if a lower base fee package would save money, no message is displayed.

Requirements

PART A - Graded as a homework assignment. There will be a separate Canvas Assignment for this and you will submit to PA3-PtA in WebCAT.

You are provided with a documented shell class, ISPCharge.java. You must provide a JUnit test file which will test each of the methods in the class. See futher information in the class notes for class on Monday Mar 16 regarding the constructor method and the global variables. NOTE: You do not need code to build a test file, but I am providing a class file that you can use for your testing. It is written correctly. (ISPCharge.class)

PART B - Submitted to webcat. WebCAT will be made available no later than Sunday morning Mar 22. NOTE: Each of your methods will be tested separately. Your methods must conform to the design requirements below. You will also need to submit your own test file to WebCAT.

You will write a Java applicataion consisting of two files. ISPBilling.java will include all IO and will control the production of the statement. Your main method may be no longer than 25 lines excluding declarations. If it is longer, create separate methods to handle repetitive or more complex tasks. Insure that you are building only one Scanner object. Pass it as necessary to your methods. Your application must:

A complete dialog as it would appear at the command line would look like this. (with input values highlighted in red and italicized). Notice how the labels all line up. The A of Additional Hours is left justified in the first position of the line. 

Dukes ISP Billing

Enter the package code (A, B, or C): A
Enter the number of hours used: 20
Customer Bill

Package: A
Hours used: 20.0

Base charge: $9.95
Additional hours: 10.0

Total charge: $29.95
Tax: $1.50

Pay this amount: $31.45

You could have saved $16.00 with package B. Call 1-888-555-1234 for more information.
You could have saved $10.00 with package C. Call 1-888-555-1234 for more information.

Output specifications

Prompts

Dukes ISP Billing
   
Enter the package code (A, B, or C): C
Enter the number of hours used: 20

Customer Bill 
   
         Package: C
      Hours used: 20.0

     Base charge: $19.95
 
    Total charge: $19.95
             Tax: $1.00
 
 Pay this amount: $20.95

Results

Additional notes in output:
Error handling:
Dukes ISP Billing

Enter the package code (A, B, or C): q
You entered q. Using A
Enter the number of hours used: -87.uu
You entered -87.uu. Using 0

Customer Bill

Package: A
Hours used: 10.0
     Base charge: $9.95
Additional hours: 0.0

Total charge: $9.95
  Tax: $0.50

Pay this amount: $10.45

NOTES:

Design Requirements

  1. You must use the starter file ISPCharge.java.
  2. You must call your driver ISPBilling.java.
  3. You may add additional methods to either ISPBilling.java or ISPCharge.java, but ONLY if they are adding simplicity to the code or removing complex calculations.
Style Requirements
  1. As always, use the class Style Guide as a guide. It is found in Canvas in the Resources module. I will enforce putting methods in alphabetic order on this PA. 
  2. If no acknowledgement is provided, you will be deducted 5 points instead of the usual 2. This must be in at least the file containing main. 
  3. Any absent class or method documentation will be deducted 2 points for each occurence.
  4. The shell program documentation is incomplete and contains embedded instructions. You must clean up this documentation to include all required elements and to remove any comments such as ("The rest is left for you to fill in...").

Part B Deliverables

  1. You should submit, ISPBilling.java and ISPCharge.jave to via Web-CAT (http://webcat.cs.jmu.edu). You must package your files into a single zip package because you can only upload a single file to WebCAT.
  2. Your program will be judged on correctness (80%) and conformance to the StyleGuide (20%). Your program must pass all submission tests to be graded. The checkoff chart is found in Canvas in the Resources module..

Part C Reflection - graded as a regular homework assignment. There will be separate Canvas Assignments for this.

You will write a reflection document for this assignment which will let you consider the process of building this program. It will also contain a place to critique this assignment for this class.

Honor Code

This is an individual programming assignment. This assignment should be viewed as a take home exam. Your work on the assignment and your submission must conform to the JMU Honor Code. Authorized help is limited to the classroom handouts, lab material, the TAs for any CS139, our graduate student and the professor. Copying work from another student or the Internet is an honor code violation, which will result in a zero on the assignment and possibly further sanctions. You may use the internet to search for help, but each site that you use hould be acknowledged in the Reference section of the code documentation.

Your work on this assignment is subject to review by MOSS which is a plagiarism detection tool for programs. Submission to WebCAT constitutes your submission of work for academic credit and your agreement that your work may be submitted to MOSS.