EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
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 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:
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 that prompts the capacity, in gallons, of an automobile fuel tank and the miles per gallon theautomobile can be driven without refueling.
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
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY