Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

ISBN: 0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

Question What is a secular trust?

Answered: 1 week ago