Question: Decision or Selection Structures and Loops ( Decision Tree: If - else if - else loop ) The charges for Wireless for one of the

Decision or Selection Structures and Loops
(Decision Tree: If - else if - else loop) The charges for Wireless for one of the mobile companies is given in the following table. Use if else if else decision structure.
Plan
Allowed Data Per User
Monthly Charges per user
Plan15
Less than 15 GB
$14.99
Plan25
Less than 25 GB
$24.50
Plan50
Less than 50 GB
$35.00
Unlimited
Greater than or equal to 50GB
$50.00
Write a JAVA method to calculate the annual charges fine calcAnnChargeFirstname called from main.
The variables in the program should be named as shown below and should be input by the user:
expectedDataUsage_firstname_//(Expected data usage per user in the household int data type)
numUsers_firstname //( Number of users in the household int Data type)
tax_pct_firstname //( A double data type) This is the tax percentage on the invoice. Tax is applied on the overall calculated charges.
The program also should display the following message for each of the above cases as shown in the table below:
Allowed Data Per User
Message
Less than 15 GB
You are on Plan15 and can use upto15 GB per month per user
Less than 25 GB
You are on Plan25 and can use upto 25 GB per month per user
Less than 50 GB
You are on Plan50 and can use upto 50 GB per month per user
Greater than or equal to 50GB
You are on Unlimited plan and Enjoy unlimited data for all users
Your method should calculate the Annual total charges per household including the taxes and also should do the display.
Charges should be calculated using an if - else if - else decision structure and make it more efficient by not repeating code as much as possible.
The Message from the above table should be displayed using a Switch Case decision structure.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!