It's a pretty simple assignment. Objectives: Write Java arithmetic expressions; Handle keyboard input and console output; Use decision structure and repetition structures to solve application...

1 answer below »
It's a pretty simple assignment.
Objectives: Write Java arithmetic expressions; Handle keyboard input and console output; Use decision structure and repetition structures to solve application problems; Generate formatted output. Tasks: Create a new project called BCS345hw1 and use the default package for it. Add a new Java class file named BCS345hw1, write statements that perform the following two tasks: 1. Task 1 Assume a mobile phone service provider has three different service plans for its customers: Mobile Phone Service Plan Plan A: $39.99 per month. 450 free minutes. Additional usage costs $0.45 per minute. Plan B: $59.99 per month. 900 free minutes. Additional usage costs $0.40 per minute. Plan C: $69.99 per month. Unlimited minutes. Write statements that ask for a customer’s name, plan information, and minutes used in a month, calculate and display the customer’s monthly bill, as well as display saving information if the customer had used a different plan. The detailed tasks are as follows: 1) Display the above menu to the customer. 2) Prompt the user for his or her full name. 3) Ask which plan the customer has purchased. The program should accept lowercase or uppercase letter of A, B, and C. If the customer enters any other letter, display an error message and ask the customer to re-enter the plan name until a valid plan name is entered. 4) Ask how many minutes were used last month. The number of minutes should be a non-negative value, otherwise display an error message and ask the user to re-enter the value until a valid number is entered. 5) Calculate the customer’s monthly charge. 6) Display the customer’s full name and monthly charge on the screen. 7) Display how much money the customer would save if he/she switches to other plans. If there would be no savings by switching to other plans, display “You chose the best plan.” The currency should be displayed with 2 decimal places as shown in the sample output 1. Wherever possible, use named constants instead of numbers, for example, plan base cost, free minutes for a plan, and additional minute cost. Hints: Suggested steps: 1) Declare related constants or variables. 2) Display the menu 3) Prompt for a customer’s name, plan, and minutes used. Read user input and store into related variables. Use while loop to validate user input. 4) Calculate costs for all three plans and save them in three variables which can be used for cost comparison in the next step. 5) Use switch structure and decision structure to output monthly statement, compare costs of plans, and display saving information, if any by switching to other plan(s). 2. Task 2 In the same program, write a loop to display the 96 characters starting from the space character ‘ ’. Display 16 characters on each line with one space between characters (see sample output 2). Submission: Submit your source code file though Blackboard Course Content > Homework Assignments > BCS345_Homework1_Submission link. The file name must be BCS345hw1.java. Be sure to include the integrity statement I certify that this submission is my own original work with your name in your source file. Test your program with 9 cases shown in the self-testing worksheet and answer in the submission text whether your program passes all 9 cases; if not, which cases it failed. Multiple submissions are allowed, and the latest submission will be graded.
Answered Same DayFeb 10, 2021

Answer To: It's a pretty simple assignment. Objectives: Write Java arithmetic expressions; Handle keyboard...

Neha answered on Feb 12 2021
140 Votes
bcs345hw1-gmvldqra/BCS345hw1/.idea/misc.xml




bcs345hw1-gmvldqra/BCS345hw1/.idea/m
odules.xml






bcs345hw1-gmvldqra/BCS345hw1/.idea/workspace.xml















































1581434599580


1581434599580





























bcs345hw1-gmvldqra/BCS345hw1/BCS345hw1.iml








...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here