Chat with us, powered by LiveChat Program Specifications Write a SelfPayKiosk class to support basic operations such as scan item, cancel transaction, checkout, and make payment. SelfPayKiosk.java is provided with | Wridemy

Program Specifications Write a SelfPayKiosk class to support basic operations such as scan item, cancel transaction, checkout, and make payment. SelfPayKiosk.java is provided with

 

Program Specifications Write a SelfPayKiosk class to support basic operations such as scan item, cancel transaction, checkout, and make payment. SelfPayKiosk.java is provided with method stubs. Follow each step to gradually complete all methods.

Note: This program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress. The main() method in LabProgram.java includes basic method calls. Add statements in main() as methods are completed to support development mode testing.

Step 0. Declare private fields for number of customers served (int), total sales (double), and current amount due (double). Note the provided final variable for sales tax of 7%.

Step 1 (1 pts). 1) Complete the constructor to initialize all private fields to zero. 2) Complete the accessor methods to return the number of customers served, total sales, and current amount due. Submit for grading to confirm 1 test passes.

Step 2 (2 pt). Complete the scanItem() method. Increase the amount due by parameter price. Do not update amount due if parameter price is negative. Submit for grading to confirm 3 tests pass.

Step 3 (1 pt). Complete the checkOut() method. Multiply amount due by SALES_TAX and add to amount due. Submit for grading to confirm 4 tests pass.

Step 4 (2 pts). Complete the makePayment() method. If parameter payment is enough to pay the amount due, increase total sales by amount due, increment number of customers served, and reset amount due to zero in preparation for the next customer. However, if parameter payment is not enough, update total sales by payment and reduce amount due by payment. Do not make any changes if parameter payment is negative. Submit for grading to confirm 6 tests pass.

Step 5 (1 pt). 1) Complete the resetKiosk() method to reset all private fields to zero. 2) Complete the cancelTransaction() method to reset amount due to zero. Submit for grading to confirm 7 tests pass.

Step 6 (2 pts). Complete the simulateSales() method to perform multiple transactions with increasing prices. Use a loop to simulate parameter numSales transactions. Within the loop, call scanItem() with parameter initialPrice. Call checkOut() and makePayment() to make a payment of $1 more than the amount due. Finally, increase the item price by parameter incrPrice in preparation for the next transaction. Submit for grading to confirm 8 tests pass.

Step 7 (1 pt). Add a boolean private field to indicate if the customer has checked out and is ready to make a payment. Only allow payment after customer has checked out. The cancelTransaction() method should not reset amount due if the customer has checked out. Update the following methods by inserting assignment statements and if statements related to the boolean filed: constructor, checkOut(), makePayment(), and cancelTransaction(). Ex: Set the boolean field to false only after full payment has been made. Submit for grading to confirm all tests pass.

    Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

    Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

    Do you need an answer to this or any other questions?

    About Wridemy

    We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

    How It Works

    To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

    Are there Discounts?

    All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

    Hire a tutor today CLICK HERE to make your first order

    Related Tags

    Academic APA Writing College Course Discussion Management English Finance General Graduate History Information Justify Literature MLA