Objectives: Basic programming involving arithmetic, input, and output, output formatting, named constants, modular programming using methods, Simple decision making.
The ABC Wireless Company offers its customers the following monthly plan:
The base charge for a month is $20, which includes 100 voice minutes, 100 text messages, and 100 MB Internet data.
Usages over the allowances are charged as follows:
The purpose of the program is to compute a customer's monthly bill from the usage data.
The program needs to calculate the excess usage charges to be applied for various items (voice, text, data) in the service. Note that excess data usage will need to be rounded up to a multiple of 100 KB. So someone who used 123,456 KB of data will have to pay for 23,500 KB over plan allowance (which calculates to $2.35 for the data). The sales tax calculation can result in a fraction of a penny. This will need to be rounded to the nearest penny. You can use the round2 method from the previous assignment.
The output from the program has two clear sections: The dialog with the user, and the displayed/printed bill. These two sections should be separated by a horizontal line (a bunch of hyphens). See sample output. Use System.out.printf for formatted output.
It is possible to write this program using just the "main" method, but you should break up the code into methods (similar to the sample program BasicIPOModular.java). All these methods will accept no parameters. The main method will do the following in sequence:
1.Print the output identification line CPS 150 Assignment 2 by your name
2.Call a method to get all input data (see above)
3.Call a method to calculate excess charges, sales tax and the total amount to be billed to customer. This method involves decision making.
4.Call a method to print the bill.
5.Print the sign-off line Assignment 2 complete
You may use the methods that combine prompting and getting input values from BasicIPOModular2.java.
You should declare the variables and named constants at the class level, including the Scanner created on System.in when these are shared by methods. But any variable used in only one method should be declared as a local identifier within that method.
To get full credit for the assignment, you must do the following:
Sample results see image.