Joe’s Automotive
Joe’s Automotive
Joe’s Automotive performs the following routine maintenance 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 performs other nonroutine services and charges for parts and labor ($20 per
hour). Create an application that displays the total for a customer’s visit to Joe’s.
The form should resemble the one shown in Figure 6-25. Note: Visual Studio lets
you use an apostrophe in a project’s name, but the apostrophe will prevent you from
being able to run the project after it has been created.
The application should have the following functions:
OilLubeCharges Returns the total charges for an oil change and/or a lube job,
if any.
FlushCharges Returns the total charges for a radiator flush and/or a
transmission flush, if any.
arges Returns the total charges for an inspection, muffler replacement,
and/or a tire rotation, if any.
OtherCharges Returns the total charges for other services (parts and labor),
if any.
TaxCharges Returns the amount of sales tax, if any. Sales tax is 6%, and is
only charged on parts. If the customer purchased services only,
no sales tax is charged.
TotalCharges Returns the total charges.
The application should have the following procedures, called when the user clicks
the Clear button:
ClearOilLube Clears the check boxes for oil change and lube job.
ClearFlushes Clears the check boxes for radiator flush and transmission
flush.
ClearMisc Clears the check boxes for inspection, muffler replacement,
and tire rotation.
ClearOther Clears the text boxes for parts and labor.
ClearFees Clears the labels that display the labels in the section marked
Summary.
Input validation: Do not accept negative amounts for parts and labor charge.
Below is a start up code to give you an Idea of material level:
' Class-level declarations
Const decOIL_CHANGE As Decimal = 26D ' The oil change charge
Const decLUBE_JOB As Decimal = 18D ' The lube job charge
Const decRADIATOR_FLUSH As Decimal = 30D ' The radiator flush charge
Const decTRANSMISSION_FLUSH As Decimal = 80D ' The transmission flush charge
Const decINSPECTION As Decimal = 15D ' The inspection charge
Const decMUFFLER_REPLACEMENT As Decimal = 100D ' The muffler replacement charge
Const decTIRE_ROTATION As Decimal = 20D ' The tire rotation charge
Const decLABOR_PER_HOUR As Decimal = 20D ' The labor charge per hour
Const decSALES_TAX As Decimal = 0.06D ' The sales tax for parts
' This procedure calculates the total fees and displays them to the user.
Dim decTotalOilAndLubeCharges As Decimal ' Oil and lube total
Dim decTotalFlushCharges As Decimal ' Flushes total
Dim decTotalMiscCharges As Decimal ' Miscellaneous total
Dim decTotalOtherCharges As Decimal ' Parts and labor total
Dim decTotalTaxCharges As Decimal ' Tax on parts total
Dim decPartsCharge As Decimal ' Parts charge
Dim intHoursOfLabor As Integer ' Hours of labor
Dim decTotalServicesAndLabor As Decimal ' The total of all services and labor.
Dim decTotalCharges As Decimal ' Total of all charges
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.
End Sub
Function OilLubeCharges() As Decimal
' Initialize the total oil and lube charges to zero.
Dim decTotalOilAndLubeCharges As Decimal = 0D
End Function
Function FlushCharges() As Decimal
' Initialize the total flush charges to zero.
Dim decTotalFlushCharges As Decimal = 0D
End Function
Function MiscCharges() As Decimal
' Intitalize the total miscelaneous charges to zero.
Dim decTotalMiscCharges As Decimal = 0D
End Function
Function OtherCharges(ByVal decPartsCharge As Decimal, ByVal intHoursOfLabor As Integer) As Decimal
End Function
Function TaxCharges(ByVal decPartsCharge As Decimal) As Decimal
End Function
Function TotalCharges(ByVal decTotalOilAndLubeCharges As Decimal, ByVal decTotalFlushCharges As Decimal,
ByVal decTotalMiscCharges As Decimal, ByVal decTotalOtherCharges As Decimal,
ByVal decTotalTaxCharges As Decimal) As Decimal
End Function
Sub ClearOilLube()
End Sub
Sub ClearFlushes()
End Sub
Sub ClearMisc()
End Sub
Sub ClearOther()
End Sub
Sub ClearFees()
End Sub
12 years ago
Purchase the answer to view it

- joesautomotiveapp.zip