Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java only please. I need help with this java program. My program is not working correctly after hours of troubleshoot. Much appreciated thanks. Write a
Java only please. I need help with this java program. My program is not working correctly after hours of troubleshoot. Much appreciated thanks.
Write a program that calculates the monthly bill for a mobile phone company. As input, the program will accept: - Number of minutes of voice calls made in a month as an integer - Number of text messages sent in a month as an integer - Number of MBs of data used as an integer - Your package code [1-3] There are three packages available: Package code 1: - Package code 2: Package code 3: Package code 3: Out of package MB charges Input (example) Voice call minutes: 101 Text messages sent: 30 MBs of data used : 100 Package Code [1-3]: 1 Input (example) Voice call minutes: 101 Text messages sent: 30 MBs of data used : 100 Package Code [13]:1 Output (example) Summary of Usage: You used 101/100 minutes, you exceeded your monthly limit You used 30/150 SMS messages, you are within your monthly limit You used 100/1024 MB of data, you are within your monthly limit Charges: IMPORTANT: 1. Input validation: Check for the negative input values. Print an error message and exit the program if negative values are entered. Zero values are OK as the customer may not have used the mobile phone at all in the whole month. The only acceptable package codes are 1-3. Invalid package codes should result in an error message and the program is terminated IMPORTANT: 1. Input validation: Check for the negative input values. Print an error message and exit the program if negative values are entered. Zero values are OK as the customer may not have used the mobile phone at all in the whole month. The only acceptable package codes are 1-3. Invalid package codes should result in an error message and the program is terminated 2. The details might seem overwhelming; however, it is a very simple program. You will be using a greater number of variables and will be doing some creative conditional processing using if / else statements. 3. Feel free to take any approach as long as it works 4. The Output should be neatly formatted with all the numbers aligned, as shown in the example above. Consider using tab escape sequence character \tStep 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