Description
Create a Visual Basic program that creates a bill for an automobile repair shop. The shop bills customers at the rate of $35 per hour for labor. Parts and supplies are subject to a 5% sales tax. The customer’s name, the number of hours of labor, and the cost of parts and supplies should be entered into the program via textboxes. When the Display Bill button is clicked, the customer’s name and the 3 costs should be displayed in a list box as shown below.
- Name your application Assignment_2.
- Name the form frmAssignment_2. The title should be as depicted below.
- Name the labels lblCustomer, lblPhone, lblHours, and lblParts.
- Name the textboxes txtCustomer, txtHours, and txtParts.
- Name the listbox lstBill.
- The Customer phone textbox should be a MaskedTextBox and should allow inputs only in the form of ___-____ (3 characters, followed by a dash, followed by 4 characters). Name this MaskedTextBox mtbPhone. Show the underlines and dash in the mask.
- Add the access keys as displayed in the diagram below.
- If the user leaves the Customer, Hours, or Parts textboxes blank, produce an error message (using a MessageBox) that informs the user to enter the appropriate information and do not display the information in the listbox.
- Create variables to hold the customer, phone, hours, and parts information. Name the variables customer, phone, hours, and parts. Their data types should be string, string, double, and double, respectively.
- When the user clicks the Display Bill button, prompt the user to enter in the date of the services. Store this information in a variable called service_date. Display this date and the date the invoice is due (30 days from the date entered) in the listbox as shown below. [Hint: use the AddDays function]. Store the due date in a variable called due_date.
- Convert the customer name variable to upper case before displaying it in the listbox.
- Whenever the user clicks the Display Bill button, the listbox should be cleared before displaying the new results.
- To calculate the amounts, create three variables (labor_cost, parts_cost, and total_cost), and display these amounts in the listbox as shown below.
- Be sure to use currency format where appropriate.
- Be sure that the columns line up appropriately. [Hint: you can use the built-in Visual Basic constant “vbTab” to create neat columns in your listbox.]