Question
Total beginner in C# and Visual Studios and Windows Forms. I don't have issues designing the forms themselves but am struggling with coding the event
Total beginner in C# and Visual Studios and Windows Forms. I don't have issues designing the forms themselves but am struggling with coding the event handlers for control buttons using C#. Please leave comments with the code to help me understand the process. Here are the text box names and button names:
Text box names/variables: txtSingles, txtAlbums, txtSubtotal, txtTax, txtShipping, txtTotalDue.
Constants- singles cost($12.98), albums cost($20.98), shipping cost for singles($1.00), shipping cost for albums($1.50), tax rate(6.25%)
GroupText box names: txtTotalOrders, txtOrdersTotalDue, txtSmallestOrder, txtAverageOrder, txtLargestOrder.
Control Button names: btnCalculate, btnClear, btnExit, btnResetTotals
The following button control event handlers information:
Calculate button (btnCalculate):
if user doesn't want to order and Albums/Singles they should enter a zero.
Only after valid values are attained: Sub total should be calculated as follows:
Number of Singles ordered *$12.98 = charge for singles
Number of Albums ordered *$20.98 = charge for albums
Charge of singles + charge of albums = sub total
Sub total should display as deciimal number with 2 decimal positions.
Tax rate of 6.25% should be applied to sub total and round to the nearest cent and be displayed as a decimal with 2 decimal places.
Cost of shipping should be calculated as:
Number of singles ordered * $1.00 = shipping for singles
Number of albums ordered * $1.50 = shipping for albums
shipping for singles + shipping for albums = total shipping //display as decimal with 2 decimal positions.
total should refelct accumulation of sub total, tax, and shipping //display as decimal with 2 position
In addition to calculating the total due for transaction, total transaction counter should be incremented to show total number of orders for this session, also accumulate all total due by adding total due for this order to total due for all orders. Average order placed should be calculated as total due for all orders divided by total orders(average should be rounded to nearest cent). Display as follows:
Total number of orders as a whole number
total due for all orders as dollar amount with 2 decimal places
average order as a dollar amount with 2 decimal places
Determine smalles invoice total and largest invoice total and display amount as currency.
Focus should return to the txtSingles box
Clear Button (btnClear):
all text box values (excluding the totals Group Box) should be removed and set focus back to txtSingles
Reset Totals button (btnResetTotals):
reset totals for the sessions. txtTotalOrders, txtOrdersTotalDue, txtSmallestOrder, txtAverageOrder, txtLargestOrder should be cleared and accumulators reset to their initial values. Focus return to txtSingle and entry should be highlighted or selected.
Thank you so much for the help.
Order Total Vinyl by Linyl Inu Totals Number of Singles: Total Orders: Number of Albums: Total Due: Smallest Order Average Order: Largest Order: Subtotal: Tax: Shipping Charge: Total Due: Reset Totals Calculate Total Clear ExitStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started