Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a class that calculates a customer's monthly bill. It should store the letter of the package the customer has purchased ( A , B

Design a class that calculates a customer's monthly bill. It should
store the letter of the package the customer has purchased (A, B, or
C) and the number of minutes that were used. It should have a method
that returns the total charges. Demonstrate the class in a program
that asks the user to select a package and enter the number of minutes
used. The program should display the total charges
MobileCharges
PACKAGE_IDENTIFIER_A: char ='A'
PACKAGE_IDENTIFIER_B: char ='B'
PACKAGE_IDENTIFIER_C: char ='C'
PURCHASE_PRICE_A : double =39.99
PURCHASE_PRICE_B : double =59.99
PURCHASE_PRICE_C : double =69.99
MINUTES_PROVIDED_A : double =450.0
MINUTES_PROVIDED_B : double =900.0
MINUTES_PROVIDED_C : double =44640.0
PRICE_PER_MINUTE_A : double =0.45
PRICE_PER_MINUTE_B ; double =0.40
PRICE_PER_MINUTE_C : double =0.00
packageldentifier : char
minutesUsed ; double
minutesProvided : double
pricePerMinute : double
purchasePrice : double
additionalMinutes : double
additionalCharges ; double
totalCharges : double
MobileCharges(p; char, m; double)
setPackageldentifier(p : char) : void
setMinutesUsed(m : double) : void
getPackageldentifier() : char
getMinutesUsed 0 : double
getMinutesProvided (); double
getPricePerMinute (): double
getPurchasePrice 0 : double
getAdditionalMinutes() : double
getAdditionalCharges0: double
getTotalCharges 0 : double
assuming that the Class MobileCharges is complete and filled out
create MobileChargesDemo so the Java project can actually carry out what it's supposed to do with this template
//Template MobileChargesDemo
import java.text.DecimalFormat; // For the DecimalFormat class
import java.util.Scanner; // For the Scanner class
public class MobileChargesDemo
{
public static void main(String[] args)
{
String input; // To hold a line of input
char packageChr; // To hold the package identifier
double minutes; // To hold the number of minutes
// Create a Scanner object for keyboard input.
Scanner keyboard = new Scanner(System.in);
// Get the package.
System.out.print("Enter the package the customer has purchased (A, B, or C): ");
input = keyboard.nextLine();
packageChr = input.charAt(0);
packageChr = Character.toUpperCase(packageChr);
// Validate the package indentifier.
// Add your code
// Add your code
// Add your code
// Add your code
// Add your code
}
}
image text in transcribed

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

Step: 3

blur-text-image

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

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago