Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can someone please help me with this coding? Joes automotive performs the follow

ID: 3656045 • Letter: C

Question

Can someone please help me with this coding? Joes automotive performs the following services Oil Change $26.00 Lube Job $18.00 Radiator Flush $30.00 Transmission Flush $80.00 Inspection $15.00 Muffler Replacement $100.00 Tire Rotation $20.00 Joe also preforms other services and charges for parts and labor ($20.00 per hour). Create an application that displays the total for a customers visit to Joes. The application should have the following functions OilLubeCharges - Returns the t0tal charges for an oil and/or lube job, if any FlushCharges - returns the total charges for a radiator and/or a transmission flush, if any MiscCharges - Returns the total charges for an inspection, muffler replacement, and/or tire rotation, if any OtherCharges - Returns the total charges for other services (parts and labor), if any TaxCharges - Returns amount of sales tax, if any. Sales tax is 6%, and only charged on parts. input validation: do not accept negative numbers or letters on parts and labor charges

Explanation / Answer

Public Class Form1 Const decTAX_RATE As Decimal = 0.06D 'Sales tax charged on parts cost Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalcTotal.Click ' This proedure calculates the total of an order. Dim decServicesLabor As Decimal ' Holds the labor and services total Dim decParts As Decimal ' holds the parts order Dim decTax As Decimal ' holds the tax on parts Dim decTotal As Decimal ' holds the order total decServicesLabor = OilLubeCharges() + FlushCharges() + MiscCharges() + OtherCharges() decParts = PartsCost() decTax = CalcTax(decParts) decTotal = decServicesLabor + decTax lblServiceLabor.Text = decServicesLabor.ToString("c") lblPartsTotal.Text = decParts.ToString("c") lblTaxOnParts.Text = decTax.ToString("c") lblTotalFees.Text = decTotal.ToString("c") End Sub Function PartsIsValid() As Boolean ' Declare a value to temporarily hold the parts value. Dim decTempValue As Decimal If Not Decimal.TryParse(txtPartsCharge.Text, decTempValue) Then MessageBox.Show("Enter a numeric value for the parts cost.") Return False End If If decTempValue < 0 Then MessageBox.Show("Enter a positive value for the parts cost.") End If ' If we have made it this far, the value is valid, so return true. Return True End Function Function LaborIsValid() As Boolean ' Declare a value to temporarily hold the labor value. Dim decTempValue2 As Decimal If Not Decimal.TryParse(txtLaborCharge.Text, decTempValue2) Then MessageBox.Show("Enter a numeric value for the labor cost.") Return False End If If decTempValue2 < 0 Then MessageBox.Show("Enter a positive value for the labor cost.") End If ' If we have made it this far, the value is valid, so return true. Return True End Function Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click ' This procedure resets the controls to default values ResetOilLubeCharges() ResetFlushCharges() ResetMiscCharges() ' Clears the text Boxes in the Parts and Labor box txtPartsCharge.Clear() txtLaborCharge.Clear() ' Clears the boxes in the Summary Box. lblServiceLabor.Text = String.Empty lblTaxOnParts.Text = String.Empty lblPartsTotal.Text = String.Empty lblTotalFees.Text = String.Empty End Sub Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click ' End the application. Me.Close() End Sub Function OilLubeCharges() As Decimal 'This function returns the cost of the Oil and Lube Charges. Dim decCostOfOilLube As Decimal = 0 If chkOilChange.Checked = True Then decCostOfOilLube += 26D End If If chkLube.Checked = True Then decCostOfOilLube += 18D End If Return decCostOfOilLube End Function Function FlushCharges() As Decimal ' This function returns the cost of the Flush Charges. Dim decCostOfFlush As Decimal = 0 If chkRadiatorFlush.Checked = True Then decCostOfFlush += 30D End If If chkTransFlush.Checked = True Then decCostOfFlush += 80D End If Return decCostOfFlush End Function Function MiscCharges() As Decimal ' This function returns the cost of misc. Dim decCostOfMisc As Decimal = 0 If chkInspection.Checked = True Then decCostOfMisc += 15D End If If chkReplaceMuffler.Checked = True Then decCostOfMisc += 100D End If If chkTireRotate.Checked = True Then decCostOfMisc += 20D End If Return decCostOfMisc End Function Function PartsCost() As Decimal ' This function returns the cost of parts. Dim decPartsCharge As Decimal decPartsCharge = CDec(txtPartsCharge.Text) Return decPartsCharge End Function Function OtherCharges() As Decimal ' This function returns the cost of labor. Dim decLarborCharge As Decimal decLarborCharge = CDec(txtLaborCharge.Text) Return decLarborCharge End Function Function CalcTax(ByVal decAmount As Decimal) As Decimal ' this function receives the parts amount. It ' calculates and returns the parts tax, based ' on the parts amount. Dim decPartsCost As Decimal If txtPartsCharge.Text = String.Empty Then Return 0 Else decPartsCost = CDec(txtPartsCharge.Text) Return decPartsCost * decTAX_RATE End If End Function Private Sub ResetOilLubeCharges() ' This procedure resets the Oil and Lube selection. chkOilChange.Checked = False chkLube.Checked = False End Sub Sub ResetFlushCharges() ' this procedure resets the flush charges. chkRadiatorFlush.Checked = False chkTransFlush.Checked = False End Sub Sub ResetMiscCharges() ' this procedure resets misc charges. chkInspection.Checked = False chkReplaceMuffler.Checked = False chkTireRotate.Checked = False End SubEnd Class ============================================================= If you face any problem in above code. Make decTotal = decServicesLabor + decTax To decTotal = decServicesLabor + decTax + decParts ==============================================