Question: This is java language Take in user input. You need to take in 4 things: An number representing the plan number (1, 2, or 3)
This is java language
Take in user input. You need to take in 4 things:
- An number representing the plan number (1, 2, or 3) (integer)
- The number of minutes used this billing cycle. (integer)
- The number of messages used this billing cycle (integer)
- The number of gigabytes of data used this cycle (double)
Note: the autograder will give you these values in this order. Make sure you read them in the correct order.
Your goal: Given the above criteria calculate the total price for a given billing cycle.
| Plan | Minutes | Messages | Data | Base Price | Service Fee | Tax |
| 1 | Unlimited | Unlimiated | Unlimited | $175 | 2% | 6% |
| 2 | 300 | 650 | 6 | $125 | 4% | 6% |
| 3 | 150 | 350 | 3 | $80 | 4% | 6% |
Plans 2 and 3 have overage charges. Individuals on these plans will pay 15 cents per minute, 10 cents per message. and $10 per gigabyte of data over their plan's allowance.
Overages are assessed before the Service Fee, and the Service Fee is taken before tax, and is taxable.
The autograder is expecting a single line of output. Containing only your formatted price with a "$" and 2 decimal places.
Examples:
Plan 1, Minutes: 600, Messages: 4000, Data: 7.13.
- Base Price is 175
- service fee is 2% before tax total is now $178.50.
- Tax is 6%, new total after tax is $189.21.
Plan 2, Minutes 400, Messages: 400, Data 6.12.
- Base price is 125
- Over 100 minutes
- 100 * .15 = $15
- Under on Messages
- No overage
- Over .12 GB on data
- .12 * $10 = $1.2
- New Total before service fee $141.20
- Service fee is 4% total is now $146.848
- Now Tax 6% total is now $155.66
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
