Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is programmed in java. I have tried to get help from others on here but it seems like they cant get it to fully

This is programmed in java. I have tried to get help from others on here but it seems like they cant get it to fully work. My code and the question are below.

/* * This program calculates a customers monthly bill */ package hw3;

import java.util.Scanner; public class dataplan {

public static void main(String[] args) { // Define variables int GBs, Holder; double Bill; String Plan = " "; Scanner input = new Scanner(System.in); System.out.println("Enter what data plan you have (A, B, or C): "); Plan = input.next(); do { System.out.println("You did not enter a valid data plan try again"); System.out.println("Enter what data plan you have (A, B, or C): "); Plan = input.next(); }while (Plan != "A" || Plan != "B" || Plan != "C"); System.out.println("Enter how many GBs of data you used (Between 1 and 50): "); GBs = input.nextInt(); do { System.out.println("You did not enter a valid amount of GBs"); System.out.println("Enter how many GBs of data you used (Between 1 and 50): "); GBs = input.nextInt(); }while (GBs 50); if (Plan == "A") { Holder = (GBs - 2); Bill = (((Holder) * 10) + 29.99); System.out.println("Your bill this month is $"+Bill); } else if ( Plan == "B") { Holder = (GBs - 4); Bill = (((Holder) * 5) + 39.99); System.out.println("Your bill this month is $"+Bill); } else { Bill = 49.99; System.out.println("Your bill this month is $"+Bill); } if (GBs

input.close(); }

}

image text in transcribed

Wireless Service Provider) A Wireless service provider has three different packages for its customers: Package A: For $29.99 per month 2GB of data is provided. Additional data is $10.00 Package B: For $39.99 per month 4GB of data is provided. Additional data is $5.00 Package C: For $49.99 per month unlimited data is provided. per GB per GB Write a program that calculates a customer's monthly bill. It should ask which package the customer has purchased and how many GB of data was used. It should then display the total amount due. The program should recommend which package is the best for the customer Input Validation: Be sure the user only select package A, B or C. Also the GB used has to be between 0 and 50

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Configure a static site-local IPv6 address, fec0:0:0:fffe::a. LO.1

Answered: 1 week ago

Question

Types of Interpersonal Relationships?

Answered: 1 week ago

Question

Self-Disclosure and Interpersonal Relationships?

Answered: 1 week ago