Question: Generic Grading Guidelines a. Please make sure youre only using the concepts already discussed in class. That is, please try and restrict yourself to loops,

Generic Grading Guidelines a. Please make sure youre only using the concepts already discussed in class. That is, please try and restrict yourself to loops, selection statements, String methods that talked on class, arrays, and your own written methods. b. The programs are worth 35 points, 35 points, 30 points. c. You do not need to perform any form of input type checks. d. Please make sure that youre conforming to specifications (program name, print statements, expected inputs and outputs etc.). e. Please make sure your code is readable. f. Please make sure youve compiled and run your program before you turn it in. -5 pts will be deducted for each compile error.

1. Profit3.java Improve the Profit2.java for last assignment to continuously receive users orders. Receive the book order from user with while loop and use switch statement to check the correct selling price and basic cost for that book and calculation the total price and profit like in assignment 1. Accumulate the users order until user enter q or Q for the book type. Then calculate the total price and profit for all the orders user made and print out the result. Book name User input Selling price per book Basic cost per book Calculus book c or C $23.49 $17.99 Physics book p or P $42.08 $33.5 Java book j or J $36.79 $18.66 a. The selling price and basic cost of your products are as above. Set these prices as constant doubles. b. As logging into the system, it prints out a welcome message as Welcome to Bookstore. c. Declare the total price and profit variables to accumulate the price and profit for each sub-order.

d. Create a while loop to keep receiving users orders. e. For each order/iteration, declare a char variable to receive the type of book from user. Declare an int variable to receive the book amount for the current trade from user. f. Check the book type. If it is q or Q, terminate the loop and print out the current total price and profit. g. Otherwise, in each iteration, based on the book type char, establish a switch structure for different book types. Inside each branch, do the following steps. h. Calculate the total price the customer should pay and print it out. This includes 12% tax of the current order total book price. = (1+12%) Calculate the current order total profit that you can earn in this trade as: = ( ) i. Add the price and profit for the current order to the total price and profit. j. When jump out of the loop (q or Q received), print out the total price and profit for all the entered orders. Round all print out to 3 digits after decimal point. Sample Run 1: Welcome to bookstore! What type of book do you want? c How many book would you like? 3 What type of book do you want? p How many book would you like? 4 What type of book do you want? Q The total price you need to pay is 267.445 The money we earn in this trade is 50.820 Sample Run 2: Welcome to bookstore! What type of book do you want? J How many book would you like? 3 What type of book do you want? c How many book would you like? 7 What type of book do you want?

p How many book would you like? 1 What type of book do you want? c How many book would you like? 2 What type of book do you want? q The total price you need to pay is 407.523 The money we earn in this trade is 112.470 Sample Run 3: Welcome to bookstore! What type of book do you want? q The total price you need to pay is 0.000 The money we earn in this trade is 0.000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!