Chapter 4- Section 2: If Blocks 50. Second Suit Half-Off Sale. A men\'s clothing
ID: 3725014 • Letter: C
Question
Chapter 4- Section 2: If Blocks 50. Second Suit Half-Off Sale. A men's clothing store advertises that if you buy a suit, you can get a second suit at half-off. What they mean is that if you buy two suits, then the price of the lower-cost suit is reduced by 50%. write a program that accepts the two costs as input and then calculates the total cost after halving the cost of the lowest price suit. See figures below Half Off Half Off Cost of first suit 378.50 Cost of first suit 545.90 Cost of second suit 495.99 Cost of second suit 489.99 Calculate Cost of Suits Calculate Cost of Suits Cost of the two suits $685.24 Cost of the two suits $790.90 orExplanation / Answer
'Place this code under button click event:
Dim a, b, sum As Double
a = Double.Parse(txtFirst.Text)
b = Double.Parse(txtSecond.Text)
If (a > b) Then
sum = a + b / 2
Else
sum = b + a / 2
End If
txtCost.Text = "$" + Format(sum, "0.00")
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.