InternetServiceProvider2.java - import [email protected] Lemuel M [email protected] Book Title From Control Structures through Objects by Tony

InternetServiceProvider2.java - import...

This preview shows page 1 - 2 out of 2 pages.

import javax.swing.JOptionPane; /** * @author Lemuel M. Uhuru * @Date June 17, 2013 * Book Title: From Control Structures through Objects by Tony Gaddis * Page: 191 Challenge 14: Internet Service Provider, Part 2 * @Description Modify the program you wrote for Programming Challenge 13 * so it also calculates and displays the amount of money Package A customers * would save if they purchased Package B or C, and the amount of money * Package B customers would save if they purchased Package C. If there would * be no savings, no message should be printed. */ public class InternetServiceProvider2 { public static void main(String[] args) { // Declare variables for package prices double priceA = 9.95; double priceB = 13.95; double priceC = 19.95; // Declare variable to hold user package char userPackage; // Declare variable to hold hours used int hours; // Prompt user for package type String input = JOptionPane.showInputDialog("Enter your package letter (A/B/C)").toUpperCase(); // Prompt user for the amount of hours used String input2 = JOptionPane.showInputDialog("Enter the amount of hours
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Spring '08
  • Garcia,D
  • Java Programming, Java Code, char userPackage, \nTotal Charges

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors