SCJ3253 - LabExercise Week 04 (#01)
SCJ3253 - LabExercise Week 04 (#01)
d Refreshment that calculates the amount due for individual orders and maintains accumulated totals for a summary. Have a chechbox for takeout items, which are taxable at 8 percent; all other orders are nontaxable. Include radiobuttons for the five drink selections Hot Chocolate, Teh Tarik, Sirap Bandung, Iced Latte and Fresh Orange. The prices for each drink as follows: Hot Chocolate Teh Tarik Sirap Bandung Iced Latte Fresh Orange - RM2.50, - RM2.20, - RM2.30, - RM3.50, - RM3.00.
Use a button for Calculate Selection, which will calculate and display the amount due for each item. Display appropriate error messages for missing or non-numeric input data. A button for Clear for Next Item will clear the selections and amount for the current item. Additional labels in a seperate group will display the summary information for the current order, including subtotal, tax and total. Buttons at the bottom of the form are New Order, Summary, and Exit (save the implementation detail for future exercise). Put an appropriate way to navigate to-from the previous page (booksales.aspx page) Plan the Project (plan the sketch of the form)
Plan the event-handling methods Button: calculateButton_Click Pseudocode: Validate for blank and non-numeric amount Find price of drink selection Multiply price by quantity Add amount to subtotal Calculate tax if needed Calculate total=subtotal + tax Format and display the result Button: Pseudocode: clearButtonClick clear each text box Clear the drink selection Clear the quantity and item price Disable the takeout checkbox Set the focus to the quantity (textbox) summaryButton_Click for future exercise newOrderButton_Click for future exercise exitButton_Click for future exercise
Write the application Follow the sketched plan to create the form Set the properties of each object with the appropriate value
Write the code. Working from the pseudocode, write each method, event handler and field validation. When you complete the code, use a variety of test data to thoroughly test the logical correctness of your application. Test with blank and non-numeric input data. Also, make sure the tab sequence is set correctly, focus point set to quantity textbox.