Internet Service Provider An Internet service provider has f

Internet Service Provider

An Internet service provider has four different subscription packages for its customers:

1. Basic: $29.99 per month 6 Mbps, NO in-home wifi

2. Standard: $34.99 per month 15 Mbps, NO in-home wifi

3. Turbo: $54.99 per month 30 Mbps, in-home wifi

ISP provided wifi modem $39.99

Customer supplied wifi modem $0

4. Ultimate: $64.99 per month 50 Mbps, in-home wifi

ISP provided wifi modem $39.99

Customer supplied wifi modem $0

Write a Java program that calculates a customer\'s initial monthly bill. The program will list out the high-speed internet plans available to customers. The program will prompt the customer to enter the number corresponding to the package they wish to purchase (ie. 1, 2, 3, 4). If the customer selects package 3 or 4, the program will prompt the customer with a Yes/No question as to whether the customer wishes to purchase the ISP wifi modem or not. If the customer answers Yes to the ISP provided wifi modem na additional $39.99 will be added to their intial monthly bill. If the customer answers No they do not incur the additional $39.99 charge.

Output may look as follows:

Available High-Speed Internet Plans:

1) Basic: $29.99 per month 6 Mbps, NO in-home wifi

2) Standard: $34.99 per month 15 Mbps, NO in-home wifi

3) Turbo: $54.99 per month 30 Mbps, in-home wifi

4) Ultimate: $64.99 per month 50 Mbps, in-home wifi

Please enter the number of the package you wish to purchase:

2

You choose plan number: 2

Initial amount due ISP: $ 34.99

The end!

Or

Available High-Speed Internet Plans:

1) Basic: $29.99 per month 6 Mbps, NO in-home wifi

2) Standard: $34.99 per month 15 Mbps, NO in-home wifi

3) Turbo: $54.99 per month 30 Mbps, in-home wifi

4) Ultimate: $64.99 per month 50 Mbps, in-home wifi

Please enter the number of the package you wish to purchase:

3

Do you wish to purchase the ISP wifi modem for an additional $39.99? (Yes/No)

yes

You choose plan number: 3 and answered YES to purchasing our wifi modem

An additional $39.99 for the wifi modem purchase is included in your amount due!

Initial amount due ISP: $ 94.98

The end!

Solution

/* ISPBill.java*/
import java.util.Scanner;

public class ISPBill
{
   public static void main (String args[])
   {
       int choice;
       double bill;
       Scanner scan = new Scanner (System.in);
      
       System.out.println(\"Available High-Speed Internet Plans:\ 1) Basic: $29.99 per month 6 Mbps, NO in-home wifi\ 2) Standard: $34.99 per month 15 Mbps, NO in-home wifi\ 3) Turbo: $54.99 per month 30 Mbps, in-home wifi\ 4) Ultimate: $64.99 per month 50 Mbps, in-home wifi\ Please enter the number of the package you wish to purchase:\");
       choice = scan.nextInt();

       if (choice == 1)
       {
           bill = 29.99;
           System.out.println(\"You choose plan number: \" + choice + \"\ Initial amount due ISP: $ \" + bill + \"\ The end!\");  
       }

       else if (choice == 2)
       {
           bill = 34.99;
           System.out.println(\"You choose plan number: \" + choice + \"\ Initial amount due ISP: $ \" + bill + \"\ The end!\");  
       }

       else if (choice == 3)
       {
           bill = 54.99;
           double additional = 39.99;
           System.out.println(\"Do you wish to purchase the ISP wifi modem for an additional $\" + bill + \"? (Yes/No) \");
           String input = scan.next();

           if (input.equals(\"Yes\") || input.equals(\"yes\") || input.equals(\"YES\"))
           {
               bill = bill + additional;
               System.out.println(\"You choose plan number: 3 and answered YES to purchasing our wifi modem\ An additional $\" + additional + \" for the wifi modem purchase is included in your amount due!\ Initial amount due ISP: $ \" + bill + \"\ The end!\");
           }

           else
           {
               System.out.println(\"You choose plan number: 3 and answered NO to purchasing our wifi modem\ NO additional for the wifi modem purchase is included in your amount due!\ Initial amount due ISP: $ \" + bill + \"\ The end!\");
           }
       }

       else if (choice == 4)
       {
           bill = 64.99;
           double additional = 39.99;
           System.out.println(\"Do you wish to purchase the ISP wifi modem for an additional $\" + bill + \"? (Yes/No) \");
           String input = scan.next();

           if (input.equals(\"Yes\") || input.equals(\"yes\") || input.equals(\"YES\"))
           {
               bill = bill + additional;
               System.out.println(\"You choose plan number: 4 and answered YES to purchasing our wifi modem\ An additional $\" + additional + \" for the wifi modem purchase is included in your amount due!\ Initial amount due ISP: $ \" + bill + \"\ The end!\");
           }

           else
           {
               System.out.println(\"You choose plan number: 4 and answered NO to purchasing our wifi modem\ NO additional for the wifi modem purchase is included in your amount due!\ Initial amount due ISP: $ \" + bill + \"\ The end!\");
           }  
       }

       else
           System.out.println(\"Invalid Input\ The end!\ \");
   }
  
  
}

/*
output:

Available High-Speed Internet Plans:
1) Basic: $29.99 per month 6 Mbps, NO in-home wifi
2) Standard: $34.99 per month 15 Mbps, NO in-home wifi
3) Turbo: $54.99 per month 30 Mbps, in-home wifi
4) Ultimate: $64.99 per month 50 Mbps, in-home wifi
Please enter the number of the package you wish to purchase:
2
You choose plan number: 2
Initial amount due ISP: $ 34.99
The end!


Available High-Speed Internet Plans:
1) Basic: $29.99 per month 6 Mbps, NO in-home wifi
2) Standard: $34.99 per month 15 Mbps, NO in-home wifi
3) Turbo: $54.99 per month 30 Mbps, in-home wifi
4) Ultimate: $64.99 per month 50 Mbps, in-home wifi
Please enter the number of the package you wish to purchase:
3
Do you wish to purchase the ISP wifi modem for an additional $54.99? (Yes/No)
Yes
You choose plan number: 3 and answered YES to purchasing our wifi modem
An additional $39.99 for the wifi modem purchase is included in your amount due!
Initial amount due ISP: $ 94.98
The end!

*/

Internet Service Provider An Internet service provider has four different subscription packages for its customers: 1. Basic: $29.99 per month 6 Mbps, NO in-home
Internet Service Provider An Internet service provider has four different subscription packages for its customers: 1. Basic: $29.99 per month 6 Mbps, NO in-home
Internet Service Provider An Internet service provider has four different subscription packages for its customers: 1. Basic: $29.99 per month 6 Mbps, NO in-home
Internet Service Provider An Internet service provider has four different subscription packages for its customers: 1. Basic: $29.99 per month 6 Mbps, NO in-home

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site