Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Program 1 - Pick Message Plan We all know how arcane cell phone companies can be

ID: 440868 • Letter: P

Question

Program 1 - Pick Message Plan We all know how arcane cell phone companies can be with their billing practices. Write a program called PickMessagePlan.java to decide which of two message plans will have a lower fee for someone's estimated average monthly usage. The structure of the fee plans is to have a fixed number of text messages bundled into a monthly charge. Text messages above the bundled amount incur an additional per message fee. To make things a bit more complicated, the cell phone provider provides an overall discount to students of up to 50%. Your program should take in the 3 fee parameters for each plan, the percentage discount, and the estimated average messages sent per month. Then calculate and output the resultant monthly fee for both plans, and say which one is cheaper, or if they cost the same. Include the previously entered thresholds in requesting information about the fee rates. INPUT: A set of integers and doubles, representing fees, messages, and rates OUTPUT: The monthly fees as a properly formatted double, along with a decision as to which plan is cheaper This is what I have so far: public static void main(String[] args) { Scanner myKeyboard = new Scanner(System.in); System.out.print("Input monthly rate for plan 1: "); double x; x = myKeyboard.nextDouble(); System.out.print("Included message for plan 1: "); double y; y = myKeyboard.nextDouble(); System.out.print("Charge per messages over 300: " ); double z; z = myKeyboard.nextDouble(); System.out.println(""); System.out.print("Input monthly rate for plan 2: "); double a; a = myKeyboard.nextDouble(); System.out.print("Included messages for plan 2: "); double b; b = myKeyboard.nextDouble(); System.out.print("Charge per message over 400: "); double c; c = myKeyboard.nextDouble(); System.out.print("Overall Discount Percentage (0-50): "); double d; d = myKeyboard.nextDouble(); System.out.println(""); System.out.print("Average Messages Used Per Month: "); double e; e = myKeyboard.nextDouble (); if ( z > 300) double deltaA = x + e; double deltaB = a + e; System.out.println("Average Cost for Plan 1: " + deltaA); System.out.println("Average Cost for Plan 2: " + deltaB); if (deltaA < deltaB) System.out.println("Plan 1 is cheaper!"); else if (deltaB > deltaA) System.out.println("Plan 2 is cheaper!"); if (deltaA == deltaB) System.out.println("The plans cost the same amount!" ); }}

Explanation / Answer

please check now :

red color missing element and blue color are correct code

public static void main(String[] args) {
    Scanner myKeyboard = new Scanner(System.in);
    System.out.print("Input monthly rate for plan 1: ");
    double x; x = myKeyboard.nextDouble();
    System.out.print("Included message for plan 1: ");
    double y; y = myKeyboard.nextDouble();
    System.out.print("Charge per messages over 300: " );
    double z; z = myKeyboard.nextDouble();
    System.out.println("");
    System.out.print("Input monthly rate for plan 2: ");
    double a; a = myKeyboard.nextDouble();
    System.out.print("Included messages for plan 2: ");
    double b; b = myKeyboard.nextDouble();
    System.out.print("Charge per message over 400: ");
    double c; c = myKeyboard.nextDouble();
    System.out.print("Overall Discount Percentage (0-50): ");
    double d; d = myKeyboard.nextDouble();
    System.out.println("");
    System.out.print("Average Messages Used Per Month: ");
    double e; e = myKeyboard.nextDouble ();
    if ( z > 300 ) {                           // if ( e > 300)
        double deltaA = x + e; // deltaA = (x - (y-e)*z*d/100) ;
      if(z > 400)

   double deltaB = a + e;         // deltaB = (a - (b-e)*c*d/100) ;

      else

          double deltaB = (a-a*d/100) ;  
         System.out.println("Average Cost for Plan 1: " + deltaA);
        System.out.println("Average Cost for Plan 2: " + deltaB);
             if (deltaA < deltaB)
                System.out.println("Plan 1 is cheaper!");
             else if (deltaB > deltaA)
                System.out.println("Plan 2 is cheaper!");
             if (deltaA == deltaB)
                System.out.println("The plans cost the same amount!" );
             }

    else{

        double deltaA = x;
        double deltaB = a;         
        System.out.println("Average Cost for Plan 1: " + deltaA);
        System.out.println("Average Cost for Plan 2: " + deltaB);
             if (deltaA < deltaB)
                System.out.println("Plan 1 is cheaper!");
             else if (deltaB > deltaA)
                System.out.println("Plan 2 is cheaper!");
             if (deltaA == deltaB)
                System.out.println("The plans cost the same amount!" );

     }


    }

// now its correct :

// please rate

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote