EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Question
Chapter 5, Problem 4PE
Program Plan Intro
Recommendation of recharge plan
Program plan:
- Import a necessary package.
- Create a class “CellPhoneService”,
- Define the method “main()”,
- Declare and initialize the necessary variables.
- Get the talk minutes entered into the first dialog box.
- Assign the integer value returned from the method “parseInt()”.
- Get the number of text messages entered into the second dialog box.
- Assign the integer value returned from the method “parseInt()”.
- Get the gigabytes of data entered into the third dialog box.
- Assign the integer value returned from the method “parseInt()”.
- Check whether the data balance is greater than “0”,
- Check whether the data balance is less than or equal to the minimum data balance,
- If it is true, set the plan to “E”.
- Assign the price for the plan “E”.
- Otherwise,
- Set the plan to “F”.
- Assign the price for the plan “F”.
- Check whether the data balance is less than or equal to the minimum data balance,
- Otherwise, check whether the required talk minutes is less than the minimum talk minutes,
- If it is true, check whether the number of required text messages is “0” and required data balance is “0”,
- If it is true, set the plan to “A”.
- Assign the price for the plan “A”.
- Otherwise,
- Set the plan to “B”.
- Assign the price for the plan “B”.
- If it is true, check whether the number of required text messages is “0” and required data balance is “0”,
- Otherwise, check whether the required number of text message is less than the minimum number of text messages,
- If it is true, set the plan to “C”.
- Assign the price for the plan “C”.
- Otherwise,
- Set the plan to “D”,
- Assign the price for the plan “D”.
- Concatenate the string with the determined plan and price.
- Display the plan message in dialog box.
- Define the method “main()”,
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Write a program for Horizon Phones, a provider of cellular phone service.Prompt a user for maximum monthly values for talk minutes used, text messages sent, and gigabytes of data used, and then recommend the best plan for the customer’s needs. A customer who needs fewer than 500 minutes of talk and no text or data should accept Plan A at $49 per month. A customer who needs fewer than 500 minutes of talk and any text messages should accept Plan B at $55 per month. A customer who needs 500 or more minutes of talk and no data should accept either Plan C for up to 100 text messages at $61 per month or Plan D for100 text messages or more at $70 per month. A customer who needs any data should accept Plan E for up to 3 gigabytes at $79 or Plan F for 3 gigabytes or more at $87. Save the file as CellPhoneService.java.
Write a program that asks users when their birthday is. Use information provided to give them their astrological sign. Each of the twelve signs should display a different horoscope. Use the following dates for each sign, keeping in mind that both month and day must be evaluated for an accurate result.
Aries: March 21–April 20
Taurus: April 21–May 21
Gemini: May 22–June 21
Cancer: June 22–July 22
Leo: July 23–August 22
Virgo: August 23–September 23
Libra: September 24–October 23
Scorpio: October 24–November 22
Sagittarius: November 23–December 21
Capricorn: December 22–January 20
Aquarius: January 21–February 19
Pisces: February 20–March 20
Write a program in Restaurant.cpp to help a local restaurant automate its breakfast billing system. The program should do the following:
Show the customer the different breakfast items offered by the restaurant.
Allow the customer to select more than one item from the menu.
Calculate and print the bill.
Assume that the restaurant offers the following breakfast items (the price of each item is shown to the right of the item):
Name
Price
Egg (cooked to order)
$1.99
Golden-Brown Pancake
$1.99
French Toast
$2.99
Muffin
$0.99
Bagel w/ Spread
$1.20
Fresh Fruit
$3.49
Steel-Cut Irish Oatmeal
$4.69
Coffee
$1.50
Pot of Assorted Tea
$1.75
Hot Chocolate
$1.75
Define a struct named MenuItem with two components: name of type string and price of type double. Use an array of the struct MenuItem to store each menu item and a parallel array to store the quantity of each item a customer orders.
Your program must contain at least the following functions:
Function getData: This…
Chapter 5 Solutions
EBK JAVA PROGRAMMING
Ch. 5 - Prob. 1RQCh. 5 - Prob. 2RQCh. 5 - Prob. 3RQCh. 5 - Prob. 4RQCh. 5 - Prob. 5RQCh. 5 - Prob. 6RQCh. 5 - Prob. 7RQCh. 5 - Prob. 8RQCh. 5 - Prob. 9RQCh. 5 - Prob. 10RQ
Ch. 5 - Prob. 11RQCh. 5 - Prob. 12RQCh. 5 - Prob. 13RQCh. 5 - Prob. 14RQCh. 5 - Prob. 16RQCh. 5 - Prob. 17RQCh. 5 - Prob. 18RQCh. 5 - Prob. 19RQCh. 5 - Prob. 20RQCh. 5 - Prob. 1PECh. 5 - Prob. 2PECh. 5 - Prob. 3PECh. 5 - Prob. 4PECh. 5 - Prob. 5PECh. 5 - Prob. 6PECh. 5 - Prob. 7PECh. 5 - Prob. 8PECh. 5 - Prob. 9PECh. 5 - Prob. 10PECh. 5 - Prob. 1GZCh. 5 - Prob. 2GZCh. 5 - Prob. 3GZCh. 5 - Prob. 4GZCh. 5 - Prob. 5GZ
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a program in Java language to manage a hotel with 25 rooms, 10 rooms are executive, with price 2500 Gh cedis, 7 rooms are charlet, with amount 1500 Gh cedis, 7 rooms are normal, with amount 500 Gh cedis, The program should allow customers to book rooms for a number of nights and update the number of empty rooms available for each category when a customer has fully paid and has checked- in, also update the number of empty rooms when the customer has checks-out Customers should make bookings with their first name and telephone number A customer should be prompted to know if a room has been booked ( meaning another customer has booked it but not fully paid or not checked-in ) A customer should be prompted to know if a room has been occupied ( meaning another customer has fully paid or checked-in) A customer should be prompted to know if a room is available ( meaning the room is neither been booked nor checked in) A customer should be able to know if an available room from…arrow_forwardWrite a program that calculates and prints the bill for a cellular telephone company. The company offers two types of service: regular and premium. Rates vary based on the type of service and are computed as follows:arrow_forwardAn Internet service provider has three different subscription packages for its customers:Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00per hour.Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00per hour.Package C: For $19.95 per month unlimited access is provided.Write a program that calculates a customer’s monthly bill. It should ask the user to enter theletter of the package the customer has purchased (A, B, or C) and the number of hours thatwere used. It should then display the total charges. Please program in C++ Requirements: Please include a Flowchart and the pseudocode for your programarrow_forward
- An Internet service provider has three different subscription packages for its customers: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program that calculates a customer’s monthly bill. It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of hours that were used. It should then display the total charges. Requirements: Please include a Flowchart and the pseudocode for your program and use Visual Basicarrow_forwardAn Internet service provider has three different subscription packages for its customers: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program that calculates a customer’s monthly bill. It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of hours that were used. It should then display the total charges. Using Visual Basic I need help finishing this code this is what I got so far Dim decpackageA As DecimalDim decpackageA1 As DecimalDim decpackageB As DecimalDim decpackageB1 As DecimalDim decpackageC As DecimalDim inthours_worked As IntegerDim dectotal_chargespackageA As DecimalDim dectotal_chargespackageB As DecimalDim dectotal_chargespackageC As DecimalDim dbltotal_charges As Double 'Assign the textbox…arrow_forwardAn International Internet phone company has three different subscription packages for its customers:Package A: For $9.95 per month 5 hours of call time are provided. Additional usage costs $0.08 per minute.Package B: For $14.95 per month 10 hours of call time are provided. Additional usage costs $0.06 per minute.Package C: For $19.95 per month unlimited call time is provided.Write a program that calculates a customer’s monthly bill. It should input customer name, which package the customer has purchased, and how many hours were used. It should then create a bill that includes the input information and the total amount due. Wherever possible use named constants instead of numbers.arrow_forward
- Write a C program that calculates and prints the bill for a cellular telephone company. The company offers two types of services: regular and premium, each with varying rates based on usage.The rates are computed as follows:Regular service:- $10.00 base charge with the first 50 minutes being free.- Charges for usage beyond 50 minutes are $0.20 per minute.Premium service:- $25.00 base charge with different rates for day and night usage: a. For calls made from 6:00 a.m. to 6:00 p.m., the first 75 minutes are free, and charges for usage beyond 75 minutes are $0.10 per minute. b. For calls made from 6:00 p.m. to 6:00 a.m., the first 100 minutes are free, and charges for usage beyond 100 minutes are $0.05 per minute.The program should prompt the user to enter an account number, a service code (as a character), and the number of minutes the service was used. A service code of 'r' or 'R' represents regular service, while 'p' or 'P' represents premium service. Any other character should be…arrow_forwardWrite a program for the Animal Express delivery company. The company charges by the kilogram for shipping animals. There are different rates for within Canada and International. Accept an animal weight and destination and display the shipping charge based on the following rates: Weight Canada/International: less than 2 kilograms $10.50/S18.50 greater than 2 kgs, less than 5kgs S14.50/S23.50 greater than 5 kgs $20.50/$30.00arrow_forwardWrite a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input. Output the login name, which is made up of the first five letters of the last name, followed by the first letter of the first name, and then the last two digits of the number (use the % operator). If the last name has less than five letters, then use all letters of the last name. Ex: If the input is: Michael Jordan 1991 the output is: Your login name: JordaM91 Ex: If the input is: Kanye West 2024 the output is: Your login name: WestK24 367012.2549490.qx3zqy7 LAB 4.32.1: LAB: Login name 0/10 АCTIVITY LabProgram.java Load default template... 1 import java.util.Scanner; 2 3 public class LabProgram { 4 public static void main(String[] args) { 7 * Type your code here. 8 } 10 } 9.arrow_forward
- Write a program to simulate a bank transaction. As the banker, create a single pin number for all customer that enter the bank (a constant variable). You are now ready for customer transactions. Prompt the customer for their name and pin number. If the pin number does not match your banker pin number, then they are not a valid customer. Send them away. If the customer is a valid customer, there are two bank accounts: checking and savings. First, ask for the initial balances of the bank accounts; reject negative balances. Then ask for the transactions; options are deposit, withdrawal, and transfer. Then ask for the account; options are checking and savings. Then ask for the amount; reject transactions that overdraw an account. At the end, display the balances of both accounts (using printf) to two decimal places and with a leading dollar sign.arrow_forwardA supermarket is doing a sales promotion for soft drinks. If one day you buy soft drinks and bring the empty bottles the next day, they exchange each set of K empty bottles for a full one. A customer wants to make the most of this offer and therefore bought several bottles on the first day of the promotion. Now he wants to know how many bottles he will have at the end of the second day of the promotion if he use it to the fullest. Make a program to calculate this. Input The first input line contains integer T (1 ≤ T ≤ 10000), which indicates the number of test cases. In each of the following T lines come two integers N and K (1 ≤ K, N ≤ 10000), respectively the number of soft drinks bought and the number of empty bottles to gain a full. Output For each test case print the number of bottles that the customer will have on the second day, if he makes the most of the offer.arrow_forwardImagine you are working for a lumber company, and your employer would like a program that calculates the cost of lumber for a customer order. The company sells pine, fir, cedar, maple, and oak lumber. The lumber is priced by board feet. One board foot equals one square foot that is one inch thick. The price per board foot is given in the following table: Pine 0.89 Fir 1.09 Cedar 2.26 Maple 4.50 Oak 3.10 The lumber is sold in different dimensions (specified in inches of width and height, and feet of length) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4 inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which when divided by 12 = 5.333 board feet). Create a blank c++ Give the customer instructions and then ask the user (customer) to identify the items they wish to purchase by inputting the type of wood, the length, width, & heights of the board, and the number of boards they desire. Allow the user to…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY