Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( 1 ) Switch To Light Mode ( HAS TWO parts / methods ) Question 1 ( 7 5 points ) Decision or Selection Structures
Switch To Light Mode
HAS TWO partsmethods
Question points
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.
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 firstnameExpected data usage per user
in the household int data type
numUsers firstname Number of users in the household int
Data type
taxpctfirstname 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
Less than
Less than
Less than
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.
Following are examples which you can use for testing. Please
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 ifelse if else
Switch Case decision structure.
Following are examples which you can use for testing. Please
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started