Any help would be appreciated (Java). An upstart cell phone service provider would like you to write
Any help would be appreciated (Java). An upstart cell phone service provider would like you to write aprogram to generate cell phone bills. The company offers single plans and family plans, with thefollowing rates:
Single plan: $29.99 for the one line
Family plan: $49.99 total for the first two lines
Additional $22.00 for the third line
Additional $12.00 for each additional line after that
These monthly rates include unlimited talk and text, and 2 GB ofdata per phone line.
Both plans charge $8.49 per GB for data overages. Implementation Requirements
The program will be written in NetBeans.
? Create a new project named: Topic8project ? with a main class name of: CellPhoneBillGenerator Within your program code, you must:
? Include complete program description and author in the top offile comments ? Include comments above each defined method, including a methoddescription and @param and
@return tags for parameters and return values. ? Define and use constants for ALL fixed prices and the includedGB per line (so there should be
no hardcoded values in the program calculations).
o Instead of defining all constants in the main method, eachconstant should be defined
within the method that uses it
From the main method: ? First display one line program description to the user. ? Then prompt for and read the following inputs from theuser:
o Customer’s plan type character: S for single plan or F for familyplan, accepting both
upper and lowercase letters. Tell the user how to enter the answerin the prompt. o Data usage: The number of GBs of data used by the customer inthe past month (floating
point value, not whole numbers). o Number of lines:
? For single plans, only 1 line is allowed, and no further inputwill be necessary
? For family plans, must read this input.
A minimum of 2 lines will be on the plan, even if the user enters alower number.
The program should adjust the value for the number of lines, asnecessary. ? After reading the necessary inputs from the user, call thefour methods described below.
When the called method returns a value, be sure to store the valuereturned from the method in
a main method variable for later use. ? Method 1: a method to determine the rate for the plan. o Method will have one input parameter: the number of lines onthe plan o Method will use the number of lines to determine the monthlyrate for the plan o Method will return the plan’s monthly rate ? Method 2: a method to determine the data
overage charge for the plan
.
o Method will have two input parameters: the number of lines on theplan,
and the data used by the plan for the current month o The method should round the data used UP to the nearest wholeGB,
and then calculate the charges ? NOTE: Charges will be 0.00 when customers do not go over theirincluded data o Method will return the data overage charge ? Method 3: a method to display a plan/usage summary o Method will have two input parameters: the number of lines onthe plan,
and the data used by the plan for the current month o Method will display 2 blank lines first o Method will display plan/usage summary, formatted as shownbelow ? All details should line up on the right with the lastcharacter in position 30 ? Plan type should be displayed as a String (single orfamily) ? Data usage should be displayed rounded to 1 decimal place andinclude the units ? Method 4: a method to display the charges
o Method will have two input parameters: the plan’s monthlyrate
and the data overage charge
o Method will display 1 blank line first
o Method will display the plan rate and overage charges, along witha total,
formatted as shown below PLAN/USAGE SUMMARY
Plan: single
Number of lines: 1
Data usage: 2.5 GB
CHARGES
Plan rate 29.99
Data overage charges 8.49
——-
Total bill 38.48 Summary & Charges Output for Sample Run 2 (family plan withmultiple lines and low data usage): PLAN/USAGE SUMMARY
Plan: family
Number of lines: 3
Data usage: 5.5 GB
CHARGES
Plan rate 71.99
Data overage charges 0.00
——-
Total bill 71.99 . . .