Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with C# code for the event handlers. I've provided the GUI, just need help with the actual coding part, coding the event handler

image text in transcribed

Need help with C# code for the event handlers. I've provided the GUI, just need help with the actual coding part, coding the event handler for the buttons. Please leave comments so I understand what's going on. Here is the following information on what I need help with:

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):

private void btnCalculate_Click(object sender, EventArgs e) {

}

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):

private void btnClear_Click(object sender, EventArgs e) {

}

all text box values (excluding the totals Group Box) should be removed and set focus back to txtSingles

Reset Totals button (btnResetTotals):

private void button1_Click(object sender, EventArgs e) {

}

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 Exit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

Identify and discuss the Occupational Safety and Health (OSH) Act.

Answered: 1 week ago

Question

DEFINE human resources planning (HRP) and

Answered: 1 week ago