Do problem #4 at the end of chapter 6 in Programming Challenges Note: Do not let
ID: 3566891 • Letter: D
Question
Do problem #4 at the end of chapter 6 in Programming Challenges
Note: Do not let the application throw an exception if the input for parts or labor can not be converted to numbers
Note: Labor is given as a number of hours. Your code will multiply that by the $20 per hour charge, Don't expect the user to calculate the labor cost.
Do not put an apostrophe (') in the project name.
4. 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 loe also performs other nonroutine services and charges for parts and labor hour). Create an application The form should resemble the one shown in Figure 6-25. Note: Visual Studioets you use an apostrophe in a project's name, but the apostrophe will prevent being able to run the project after it has been created. ($20 per lication that displays the total for a customer's visit to Joe's. 5. Note: Visual Studio lets the apostrophe will prevent you fromExplanation / Answer
please find basic skeleton of programming :
Public Class Joe_Automative
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
End Sub
Function OilLubeCharges() As Integer
' local variable declaration */
Dim result As Integer
Return result
End Function
Function FlushCharges() As Integer
' local variable declaration */
Dim result As Integer
Return result
End Function
Function MisCharges() As Integer
' local variable declaration */
Dim result As Integer
Return result
End Function
Function OtherCharges() As Integer
' local variable declaration */
Dim result As Integer
Return result
End Function
Function TaxCharges() As Integer
' local variable declaration */
Dim result As Integer
Return result
End Function
Function TotalCharges() As Integer
' local variable declaration */
Dim result As Integer
Return result
End Function
Sub ClearOilLube()
End Sub
Sub ClearFlushes()
End Sub
Sub ClearMisc()
End Sub
Sub ClearOther()
End Sub
Sub ClearFees()
End Sub
End Class
please find Design Copy Code
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Joe_Automative
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.GroupBox2 = New System.Windows.Forms.GroupBox()
Me.CheckBox1 = New System.Windows.Forms.CheckBox()
Me.CheckBox2 = New System.Windows.Forms.CheckBox()
Me.CheckBox3 = New System.Windows.Forms.CheckBox()
Me.CheckBox4 = New System.Windows.Forms.CheckBox()
Me.GroupBox3 = New System.Windows.Forms.GroupBox()
Me.CheckBox5 = New System.Windows.Forms.CheckBox()
Me.CheckBox6 = New System.Windows.Forms.CheckBox()
Me.CheckBox7 = New System.Windows.Forms.CheckBox()
Me.GroupBox4 = New System.Windows.Forms.GroupBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.MaskedTextBox1 = New System.Windows.Forms.MaskedTextBox()
Me.MaskedTextBox2 = New System.Windows.Forms.MaskedTextBox()
Me.GroupBox5 = New System.Windows.Forms.GroupBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
Me.Label7 = New System.Windows.Forms.Label()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.TextBox2 = New System.Windows.Forms.TextBox()
Me.TextBox3 = New System.Windows.Forms.TextBox()
Me.TextBox4 = New System.Windows.Forms.TextBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.GroupBox1.SuspendLayout()
Me.GroupBox2.SuspendLayout()
Me.GroupBox3.SuspendLayout()
Me.GroupBox4.SuspendLayout()
Me.GroupBox5.SuspendLayout()
Me.SuspendLayout()
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.CheckBox2)
Me.GroupBox1.Controls.Add(Me.CheckBox1)
Me.GroupBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.GroupBox1.Location = New System.Drawing.Point(26, 41)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(292, 124)
Me.GroupBox1.TabIndex = 0
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "GroupBox1"
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.CheckBox3)
Me.GroupBox2.Controls.Add(Me.CheckBox4)
Me.GroupBox2.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.GroupBox2.Location = New System.Drawing.Point(370, 41)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(321, 124)
Me.GroupBox2.TabIndex = 1
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "Flushes"
'
'CheckBox1
'
Me.CheckBox1.AutoSize = True
Me.CheckBox1.Location = New System.Drawing.Point(19, 33)
Me.CheckBox1.Name = "CheckBox1"
Me.CheckBox1.Size = New System.Drawing.Size(194, 22)
Me.CheckBox1.TabIndex = 2
Me.CheckBox1.Text = "Oil Change ($26.00)"
Me.CheckBox1.UseVisualStyleBackColor = True
'
'CheckBox2
'
Me.CheckBox2.AutoSize = True
Me.CheckBox2.Location = New System.Drawing.Point(19, 79)
Me.CheckBox2.Name = "CheckBox2"
Me.CheckBox2.Size = New System.Drawing.Size(194, 22)
Me.CheckBox2.TabIndex = 3
Me.CheckBox2.Text = "Lube Job ($18.00)"
Me.CheckBox2.UseVisualStyleBackColor = True
'
'CheckBox3
'
Me.CheckBox3.AutoSize = True
Me.CheckBox3.Location = New System.Drawing.Point(20, 79)
Me.CheckBox3.Name = "CheckBox3"
Me.CheckBox3.Size = New System.Drawing.Size(263, 22)
Me.CheckBox3.TabIndex = 5
Me.CheckBox3.Text = "Transmission Flush ($18.00)"
Me.CheckBox3.UseVisualStyleBackColor = True
'
'CheckBox4
'
Me.CheckBox4.AutoSize = True
Me.CheckBox4.Location = New System.Drawing.Point(20, 33)
Me.CheckBox4.Name = "CheckBox4"
Me.CheckBox4.Size = New System.Drawing.Size(261, 22)
Me.CheckBox4.TabIndex = 4
Me.CheckBox4.Text = "Radiator Flush ($30.00)"
Me.CheckBox4.UseVisualStyleBackColor = True
'
'GroupBox3
'
Me.GroupBox3.Controls.Add(Me.CheckBox7)
Me.GroupBox3.Controls.Add(Me.CheckBox5)
Me.GroupBox3.Controls.Add(Me.CheckBox6)
Me.GroupBox3.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.GroupBox3.Location = New System.Drawing.Point(26, 206)
Me.GroupBox3.Name = "GroupBox3"
Me.GroupBox3.Size = New System.Drawing.Size(292, 130)
Me.GroupBox3.TabIndex = 2
Me.GroupBox3.TabStop = False
Me.GroupBox3.Text = "Misc"
'
'CheckBox5
'
Me.CheckBox5.AutoSize = True
Me.CheckBox5.Location = New System.Drawing.Point(19, 61)
Me.CheckBox5.Name = "CheckBox5"
Me.CheckBox5.Size = New System.Drawing.Size(220, 22)
Me.CheckBox5.TabIndex = 3
Me.CheckBox5.Text = "Replace Muttler ($100.00)"
Me.CheckBox5.UseVisualStyleBackColor = True
'
'CheckBox6
'
Me.CheckBox6.AutoSize = True
Me.CheckBox6.Location = New System.Drawing.Point(19, 33)
Me.CheckBox6.Name = "CheckBox6"
Me.CheckBox6.Size = New System.Drawing.Size(214, 22)
Me.CheckBox6.TabIndex = 2
Me.CheckBox6.Text = "Inspectors ($15.00)"
Me.CheckBox6.UseVisualStyleBackColor = True
'
'CheckBox7
'
Me.CheckBox7.AutoSize = True
Me.CheckBox7.Location = New System.Drawing.Point(19, 89)
Me.CheckBox7.Name = "CheckBox7"
Me.CheckBox7.Size = New System.Drawing.Size(218, 22)
Me.CheckBox7.TabIndex = 4
Me.CheckBox7.Text = "Tire Rotation ($100.00)"
Me.CheckBox7.UseVisualStyleBackColor = True
'
'GroupBox4
'
Me.GroupBox4.Controls.Add(Me.MaskedTextBox2)
Me.GroupBox4.Controls.Add(Me.MaskedTextBox1)
Me.GroupBox4.Controls.Add(Me.Label3)
Me.GroupBox4.Controls.Add(Me.Label2)
Me.GroupBox4.Controls.Add(Me.Label1)
Me.GroupBox4.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.GroupBox4.Location = New System.Drawing.Point(370, 217)
Me.GroupBox4.Name = "GroupBox4"
Me.GroupBox4.Size = New System.Drawing.Size(321, 119)
Me.GroupBox4.TabIndex = 3
Me.GroupBox4.TabStop = False
Me.GroupBox4.Text = "Parts & Labour"
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(20, 28)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(43, 18)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Parts"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(20, 78)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(54, 18)
Me.Label2.TabIndex = 1
Me.Label2.Text = "Labour"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(180, 78)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(123, 22)
Me.Label3.TabIndex = 2
Me.Label3.Text = "($20.00 per hour)"
'
'MaskedTextBox1
'
Me.MaskedTextBox1.Location = New System.Drawing.Point(88, 28)
Me.MaskedTextBox1.Mask = "00000"
Me.MaskedTextBox1.Name = "MaskedTextBox1"
Me.MaskedTextBox1.RejectInputOnFirstFailure = True
Me.MaskedTextBox1.Size = New System.Drawing.Size(81, 24)
Me.MaskedTextBox1.TabIndex = 5
Me.MaskedTextBox1.ValidatingType = GetType(Integer)
'
'MaskedTextBox2
'
Me.MaskedTextBox2.Location = New System.Drawing.Point(88, 76)
Me.MaskedTextBox2.Mask = "00000"
Me.MaskedTextBox2.Name = "MaskedTextBox2"
Me.MaskedTextBox2.Size = New System.Drawing.Size(81, 24)
Me.MaskedTextBox2.TabIndex = 6
Me.MaskedTextBox2.ValidatingType = GetType(Integer)
'
'GroupBox5
'
Me.GroupBox5.Controls.Add(Me.TextBox4)
Me.GroupBox5.Controls.Add(Me.TextBox3)
Me.GroupBox5.Controls.Add(Me.TextBox2)
Me.GroupBox5.Controls.Add(Me.TextBox1)
Me.GroupBox5.Controls.Add(Me.Label7)
Me.GroupBox5.Controls.Add(Me.Label6)
Me.GroupBox5.Controls.Add(Me.Label4)
Me.GroupBox5.Controls.Add(Me.Label5)
Me.GroupBox5.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.GroupBox5.Location = New System.Drawing.Point(26, 380)
Me.GroupBox5.Name = "GroupBox5"
Me.GroupBox5.Size = New System.Drawing.Size(665, 204)
Me.GroupBox5.TabIndex = 4
Me.GroupBox5.TabStop = False
Me.GroupBox5.Text = "Summary"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(230, 69)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(43, 18)
Me.Label4.TabIndex = 3
Me.Label4.Text = "Parts"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(137, 30)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(136, 18)
Me.Label5.TabIndex = 2
Me.Label5.Text = "Service And Labour"
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Location = New System.Drawing.Point(167, 109)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(106, 18)
Me.Label6.TabIndex = 4
Me.Label6.Text = "Tax (on Parts )"
'
'Label7
'
Me.Label7.AutoSize = True
Me.Label7.Location = New System.Drawing.Point(195, 146)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(78, 18)
Me.Label7.TabIndex = 5
Me.Label7.Text = "Total Fees"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(305, 27)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(100, 24)
Me.TextBox1.TabIndex = 6
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(305, 69)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(100, 24)
Me.TextBox2.TabIndex = 7
'
'TextBox3
'
Me.TextBox3.Location = New System.Drawing.Point(305, 109)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.Size = New System.Drawing.Size(100, 24)
Me.TextBox3.TabIndex = 8
'
'TextBox4
'
Me.TextBox4.Location = New System.Drawing.Point(305, 146)
Me.TextBox4.Name = "TextBox4"
Me.TextBox4.Size = New System.Drawing.Size(100, 24)
Me.TextBox4.TabIndex = 9
'
'Button1
'
Me.Button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Button1.Location = New System.Drawing.Point(45, 626)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(135, 36)
Me.Button1.TabIndex = 5
Me.Button1.Text = "Caluclate Total"
Me.Button1.UseVisualStyleBackColor = True
'
'Button2
'
Me.Button2.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Button2.Location = New System.Drawing.Point(224, 626)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(75, 36)
Me.Button2.TabIndex = 6
Me.Button2.Text = "Clear"
Me.Button2.UseVisualStyleBackColor = True
'
'Button3
'
Me.Button3.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Button3.Location = New System.Drawing.Point(331, 626)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(85, 36)
Me.Button3.TabIndex = 7
Me.Button3.Text = "Exit"
Me.Button3.UseVisualStyleBackColor = True
'
'Joe_Automative
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.SystemColors.AppWorkspace
Me.ClientSize = New System.Drawing.Size(815, 687)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.GroupBox5)
Me.Controls.Add(Me.GroupBox4)
Me.Controls.Add(Me.GroupBox3)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.GroupBox1)
Me.Name = "Joe_Automative"
Me.Text = "Joe_Automative"
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox1.PerformLayout()
Me.GroupBox2.ResumeLayout(False)
Me.GroupBox2.PerformLayout()
Me.GroupBox3.ResumeLayout(False)
Me.GroupBox3.PerformLayout()
Me.GroupBox4.ResumeLayout(False)
Me.GroupBox4.PerformLayout()
Me.GroupBox5.ResumeLayout(False)
Me.GroupBox5.PerformLayout()
Me.ResumeLayout(False)
End Sub
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents CheckBox2 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox1 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox3 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox4 As System.Windows.Forms.CheckBox
Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
Friend WithEvents CheckBox5 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox6 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox7 As System.Windows.Forms.CheckBox
Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox
Friend WithEvents MaskedTextBox2 As System.Windows.Forms.MaskedTextBox
Friend WithEvents MaskedTextBox1 As System.Windows.Forms.MaskedTextBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents GroupBox5 As System.Windows.Forms.GroupBox
Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
End Class
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.