The Mari pot Carpet Store has asked you to write a computer program to calculate
ID: 3802083 • Letter: T
Question
The Mari pot Carpet Store has asked you to write a computer program to calculate the amount a customer should be changed. The president of the company has given you the following information to help in writing the program. The carpet charge is equal to the number of square yards purchased limes the labor cost per square yard. The labor cost is equal to the number of square yards purchased times the cost per square yard. A fixed fee for floor preparation is added to some customers' bills. Large volume customers are given a percentage discount but the discount applies only to the carpel charge, not the labor costs. All customers are charged 4 percent sales tax on the carpet: there is no sales tax on the labor cost. The following is sample data for this problem. The data for customer 1 were used to produce the following sample output.Explanation / Answer
Public Class Form1
Public num_yards As Integer
Public labor_cost As Double
Public carpet_cost As Double
Public prep_cost As Double
Public discount As Double
Public Sales_Tax As Double
Public total_labor_cost As Double
Public total_discount As Double
Public total_tax As Double
Public total_carpet_cost As Double
Public final_carpet_cost As Double
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
num_yards = Val(TextBox1.Text)
labor_cost = Val(TextBox2.Text)
carpet_cost = Val(TextBox3.Text)
prep_cost = Val(TextBox4.Text)
discount = Val(TextBox5.Text)
Sales_Tax = Val(TextBox6.Text)
total_labor_cost = labor_cost * num_yards + prep_cost
total_carpet_cost = carpet_cost * num_yards
If (discount > 0) Then
total_discount = (total_carpet_cost * discount) / 100
Else
total_discount = 0
End If
total_carpet_cost = total_carpet_cost - total_discount
final_carpet_cost = total_carpet_cost + total_labor_cost
total_tax = (final_carpet_cost * Sales_Tax) / 100
final_carpet_cost = final_carpet_cost + total_tax
TextBox8.Text = final_carpet_cost
End Sub
End Class
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.