By using a function to calculate sales Tax , create a project that will produce
ID: 3708704 • Letter: B
Question
By using a function to calculate sales Tax, create a project that will produce a summary of the amounts due for Pat's Auto Repair Shop.
The Job Information form must have text boxes for the user to enter the job number, customer name, amount charged for parts. and the hours of labor.
Include labels and text boxes for Parts, Labor, Subtotal, Sales Tax, and Total Bill.
Use menus instead of Buttons.
The menus are: Calculate, Edit, Clear, Ok
The Edit Menu will have submenus for Color and Font. Use the Color Dialog and Font Dialog objects. These will affect the Display only.
The Calculate Menu finds the charges and displays them in the specified controls.
The tax rate and the hourly labor charge should be set up as named constants so that they can be easily modified if either changes., Current charges are $50 per hour for labor and 8 percent (.08) for the sales tax rate. Sales lax is charged only on parts. not on labor.
The Clear Menu clears the text boxes and resets the focus in the first text box.
The Menu OK closes the Job Information form and displays the main form. Make sure you validate all inputs except Customer Name
Do not use import System. Make the project using simple method.
frmJoblnformation Calculate Edit Clear Ok Job Number Customer Name Amount Charged Hours Of labor Parts Labor Subtotal ax Total BillExplanation / Answer
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Imports System.Windows.Forms
Namespace TaxCalculationRepairShopForm
Public Partial Class Form1
Inherits Form
Private labourChargePerHour As Integer = 50
Private salesTax As Single = 0.08F
Private partRate As Integer = 100
Private numberofParts As Integer
Private totalLabors As Integer
Private housofLabor As Integer
Public Sub New()
InitializeComponent()
End Sub
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Try
housofLabor = Convert.ToInt16(textBox4.Text)
totalLabors = Convert.ToInt16(textBox8.Text)
numberofParts = Convert.ToInt16(textBox5.Text)
Catch
MessageBox.Show("Enter proper value")
End Try
Dim amountforParts As Single = numberofParts * partRate
Dim subTotal As Single = numberofParts * (totalLabors * (housofLabor * labourChargePerHour))
textBox6.Text = Convert.ToString(subTotal)
Dim tax As Single = amountforParts * salesTax
textBox9.Text = Convert.ToString(tax)
textBox7.Text = Convert.ToString(tax + subTotal)
End Sub
Private Sub textBox4_TextChanged(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Private Sub textBox8_TextChanged(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Private Sub textBox5_TextChanged(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Private Sub textBox6_TextChanged(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Private Sub textBox9_TextChanged(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Private Sub textBox7_TextChanged(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Private Sub colorToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
Me.BackColor = Color.FromArgb(255, 232, 232)
End Sub
Private Sub button3_Click(ByVal sender As Object, ByVal e As EventArgs)
textBox1.Text = String.Empty
textBox2.Text = String.Empty
textBox3.Text = String.Empty
textBox4.Text = String.Empty
textBox5.Text = String.Empty
textBox6.Text = String.Empty
textBox7.Text = String.Empty
textBox8.Text = String.Empty
textBox9.Text = String.Empty
End Sub
Private Sub button4_Click(ByVal sender As Object, ByVal e As EventArgs)
Me.Hide()
Dim obj As Main = New Main()
obj.ShowDialog()
End Sub
End Class
End Namespace
Main form code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TaxCalculationRepairShopForm
{
public partial class Main : Form
{
public Main()
{
InitializeComponent();
}
private void jobInformationToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Hide();
Form1 obj = new Form1();
obj.ShowDialog();
}
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.