EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
8th Edition
ISBN: 9781305480537
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Videos

Question
Book Icon
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”.
      • 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”.
      • 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.

Blurred answer
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…
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
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