Question #63584

The program is for a shop that has a 5 day sale once a month. On day one, everything is discounted 5%. On day two, everything is discounted 10%. By day 5, everything is discounted by 25%. We need a program that calculates how much an item costs on each day based on the sale day. For example, a clerk enters the regular price of an item as $10.00. The program then displays the discounted price for day one, day two and so forth. For day one the price displayed would be $9.50. For day two, the price would be $9.00. By day five, the price would be $7.50. Note that you have to use a loop to do the calculations.
1

Expert's answer

2016-11-26T12:59:11-0500

Answer on Question #63584 - Programming & Computer Science | Visual Basic

Public Class frmShopPrices

Dim I As Double


Private Sub btnCulc_Click(sender As Object, e As EventArgs) Handles btnCulc.Click
    I = 0.25
    txtPrice.Text = FormatCurrency(txtPrice.Text, 2)
    For Each c As TextBox In discPrices.Controls.OfType(Of TextBox)
        c.Text = FormatCurrency(((txtPrice.Text) - CDbl(txtPrice.Text) * I), 2)
        I = I - 0.05
    Next
End Sub
Private Sub btnClr_Click(sender As Object, e As EventArgs) Handles btnClr.Click
    txtPrice.Text = ""
    For Each c As TextBox In discPrices.Controls.OfType(Of TextBox)
        c.Text = ""
    Next
    txtPrice.Focus()
End Sub


End Class



http://www.AssignmentExpert.com

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS