Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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 \t

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions

Question

Discuss five types of employee training.

Answered: 1 week ago

Question

Identify the four federally mandated employee benefits.

Answered: 1 week ago