Cоnsider the fоllоwing formulа expression (tilde expression) used in the point_plot function: vаr1 ~ vаr2 + var3 var3 will . var2 will . var1 will .
Cоding Prоblem: Cаmpus Stоre Checkout How to stаrt: In Eclipse or IDE of your choice, mаke a package named 'Exam1'. Inside the package, create a class named Exam1_{YourFirstName}{LastNameInitial} Write the code for the given problem statement, save the code and test it. How to submit: Once code is written, click 'Add a File' button and attach the .java file to this question's response section Problem Statement: You are building a simple checkout system for a campus store. The program should repeatedly allow a customer to choose items to buy and specify a quantity for each, stop when they finish, and then produce a receipt with totals and any applicable discount. Requirements: Greeting & MenuDisplay a welcome message and show a numbered menu of five choices each time the user is asked to make a selection: Choice 1) Notebook - $2.50 Choice 2) USB Drive - $9.99 Choice 3) Backpack - $39.99 Choice 4) Calculator - $24.50 Choice 0) Finish Order Ordering Loop Ask the user for a choice. If the user enters 0, end ordering and print the receipt. If the user enters 1–4, ask for a quantity. Validation Choice must be an integer in the range 0 to 4 (re‑prompt until valid). Quantity must be an integer in the range 1 to 50 (re‑prompt until valid). Item Costs Notebook costs $2.50 USB Drive costs $9.99 Backpack costs $39.99 Calculator costs $24.50 For each valid purchase, update: The running subtotal by adding unit price × quantity The total number of items by adding the quantity Immediately after each valid purchase, display a confirmation line showing what was added and the line total (currency to two decimal places). Discounts & Receipt When the user finishes (choice 0), print a receipt showing: Subtotal (before any discounts) Discount line if applicable (see rules below) Final total (after discount) Total items Discount rules: If the subtotal is $100.00 or more, apply a 10% discount Else if the subtotal is $50.00 or more, apply a 5% discount Otherwise, no discount All currency values should show two decimal places and have clear labels. Expected Output: Test Case 1: Test case demonstrating choice and quantity validation and subtotal greater than $100 Welcome to Campus Store! Please make your selections from the menu below. ----------------------------- Menu: ----------------------------- Choice 1) Notebook - $2.50 Choice 2) USB Drive - $9.99 Choice 3) Backpack - $39.99 Choice 4) Calculator - $24.50 Choice 0) Finish Order Enter your choice (0 to finish):5 Enter correct value for choice (0 to finish):3 Enter quantity (1-50):58 Enter correct value of quantity(1-50):3 Added 3 x Backpack @ $39.99 -> $119.97 ----------------------------- Menu: ----------------------------- Choice 1) Notebook - $2.50 Choice 2) USB Drive - $9.99 Choice 3) Backpack - $39.99 Choice 4) Calculator - $24.50 Choice 0) Finish Order Enter your choice (0 to finish):0 ==================== Campus Store Receipt ==================== Subtotal: $119.97 10% Discount: $12.00 Final total: $107.97 Total items: 3 Test Case 2: Test case when subtotal is greater than $50 Welcome to Campus Store! Please make your selections from the menu below. ----------------------------- Menu: ----------------------------- Choice 1) Notebook - $2.50 Choice 2) USB Drive - $9.99 Choice 3) Backpack - $39.99 Choice 4) Calculator - $24.50 Choice 0) Finish Order Enter your choice (0 to finish):3 Enter quantity (1-50):1 Added 1 x Backpack @ $39.99 -> $39.99 ----------------------------- Menu: ----------------------------- Choice 1) Notebook - $2.50 Choice 2) USB Drive - $9.99 Choice 3) Backpack - $39.99 Choice 4) Calculator - $24.50 Choice 0) Finish Order Enter your choice (0 to finish):4 Enter quantity (1-50):1 Added 1 x Calculator @ $24.50 -> $24.50 ----------------------------- Menu: ----------------------------- Choice 1) Notebook - $2.50 Choice 2) USB Drive - $9.99 Choice 3) Backpack - $39.99 Choice 4) Calculator - $24.50 Choice 0) Finish Order Enter your choice (0 to finish):0 ==================== Campus Store Receipt ==================== Subtotal: $64.49 5% Discount: $3.22 Final total: $61.27 Total items: 2