Joe\'s Automotive performs the following routine maintenance services: Oil chang
ID: 3631708 • Letter: J
Question
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
Muffer replacement - $100.00
Tire rotation - $20.00
Joe also performs other non routine services and charges for parts and labor ($20 per hour). Create an application that displays the total for a customers visit to Joes . The form should resemble the one shown below only with the modifications listed at the bottom.
The application should have the following functions:
OilLubeCharges: returns the total charges for an oil change and/or lube job, if any.
FlushCharges: returns the total charges for a radiator flush and/or transmission flush, if any.
MiscCharges 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.
Total Charges: 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.
Clear Other: Clears the text boxes for parts for parts and labor.
ClearFees: Clears the labels that display the labels in the section marked Summary.
Except make the following changes:
Do not verify input but instead assume input is correct -- use CDec. Parts input is a decimal amount, Labor input is number of hours -- decimal (the $ on the form is incorrect)
Add 3 labels for the total oil and lube charges, total flushes charges and total misc charges.
Replace the Summary group box with the following:
Total Oil and Lube Charges
Total Flushes Charges
Total Misc Charges
Total Parts and Labor Charges
Tax on Parts Charges
Total Charges
Implement the functions and procedures as described with the following change:
For the OtherCharges function, add the labor rate as a parameter.
Thanks in advance for any help.
Explanation / Answer
Public Class Form1 'Cost Constants Dim OilChange As Double = 26.0 Dim LubeJob As Double = 18.0 Dim RadiatorFlush As Double = 30.0 Dim TransmissionFlush As Double = 80.0 Dim Inspection As Double = 15.0 Dim ReplaceMuffler As Double = 100.0 Dim TireRotation As Double = 20.0 'Calculate Total Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim ServNLabor As Double = OilLubeCharges() + FlushCharges() + MiscCharges() + GetLabor() Dim Labor As Double = TextBox2.Text Dim Parts As Double = GetParts() Dim Tax As Double = Taxcharges() Dim Total As Double = TotalCharges() TextBox1.Text = Parts.ToString("C") TextBox2.Text = Labor.ToString("C") TextBox3.Text = ServNLabor.ToString("C") TextBox4.Text = Parts.ToString("C") TextBox5.Text = Tax.ToString("C") TextBox6.Text = Total.ToString("C") End Sub 'Clear the form Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ClearFees() ClearFlushes() ClearMisc() ClearOilLube() ClearOther() End Sub 'Exit the application Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub 'Calculates the charges for the oil and lube group box Function OilLubeCharges() Dim Charges As Double = 0.0 If CheckBox1.Checked = True Then Charges = Charges + OilChange End If If CheckBox2.Checked = True Then Charges = Charges + LubeJob End If Return Charges End Function 'Calculates the charges for the flushes group box Function FlushCharges() Dim Charges As Double = 0.0 If CheckBox3.Checked = True Then Charges = Charges + RadiatorFlush End If If CheckBox4.Checked = True Then Charges = Charges + TransmissionFlush End If Return Charges End Function 'Calculates the charges for the Misc. group box Function MiscCharges() Dim Charges As Double = 0.0 If CheckBox5.Checked = True Then Charges = Charges + Inspection End If If CheckBox6.Checked = True Then Charges = Charges + ReplaceMuffler End If If CheckBox7.Checked = True Then Charges = Charges + TireRotation End If Return Charges End Function 'Calculates the charges for the parts textbox Function GetParts() Dim Charges As Double = 0.0 Try Charges = Charges + TextBox1.Text Catch ex As Exception MessageBox.Show("Please enter valid input in Parts") End Try If ChargesRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.