Needs to be written using C# please provide all control names Joe\'s Automotive
ID: 3575834 • Letter: N
Question
Needs to be written using C# please provide all control names 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-31Explanation / Answer
-----------------------------
Form1.designer.cs
--------------------------------------
namespace Automotive_Shop
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.Oil_Change = new System.Windows.Forms.CheckBox();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton3 = new System.Windows.Forms.RadioButton();
this.Lube_job = new System.Windows.Forms.CheckBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.checkBox3 = new System.Windows.Forms.CheckBox();
this.checkBox4 = new System.Windows.Forms.CheckBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.Full_Synthetic = new System.Windows.Forms.RadioButton();
this.Mixed = new System.Windows.Forms.RadioButton();
this.Regular = new System.Windows.Forms.RadioButton();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.Full_Service = new System.Windows.Forms.RadioButton();
this.Complemetary = new System.Windows.Forms.RadioButton();
this.CarWash_None = new System.Windows.Forms.RadioButton();
this.Premium = new System.Windows.Forms.RadioButton();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.Radiator_flush = new System.Windows.Forms.CheckBox();
this.Transmission_flush = new System.Windows.Forms.CheckBox();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.Tire_rotation = new System.Windows.Forms.CheckBox();
this.Replace_Muffler = new System.Windows.Forms.CheckBox();
this.Inspection = new System.Windows.Forms.CheckBox();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.Parts_cost = new System.Windows.Forms.TextBox();
this.Labour_hrs = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.groupBox9 = new System.Windows.Forms.GroupBox();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.Parts = new System.Windows.Forms.TextBox();
this.Service_cost = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.Total = new System.Windows.Forms.TextBox();
this.Tax = new System.Windows.Forms.TextBox();
this.Calculate = new System.Windows.Forms.Button();
this.Clear = new System.Windows.Forms.Button();
this.Exit = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox5.SuspendLayout();
this.groupBox6.SuspendLayout();
this.groupBox7.SuspendLayout();
this.groupBox8.SuspendLayout();
this.groupBox9.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.Lube_job);
this.groupBox1.Controls.Add(this.Oil_Change);
this.groupBox1.Controls.Add(this.groupBox2);
this.groupBox1.Location = new System.Drawing.Point(25, 21);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(200, 212);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Oil and Lube";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.groupBox3);
this.groupBox2.Controls.Add(this.radioButton3);
this.groupBox2.Controls.Add(this.radioButton2);
this.groupBox2.Controls.Add(this.radioButton1);
this.groupBox2.Location = new System.Drawing.Point(15, 56);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(170, 105);
this.groupBox2.TabIndex = 0;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Oil type";
//
// Oil_Change
//
this.Oil_Change.AutoSize = true;
this.Oil_Change.Location = new System.Drawing.Point(24, 33);
this.Oil_Change.Name = "Oil_Change";
this.Oil_Change.Size = new System.Drawing.Size(117, 17);
this.Oil_Change.TabIndex = 1;
this.Oil_Change.Text = "Oil Change($26.00)";
this.Oil_Change.UseVisualStyleBackColor = true;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Location = new System.Drawing.Point(19, 20);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(89, 17);
this.radioButton1.TabIndex = 0;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "Regular($0.0)";
this.radioButton1.UseVisualStyleBackColor = true;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(19, 43);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(92, 17);
this.radioButton2.TabIndex = 1;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "Mixed($10.00)";
this.radioButton2.UseVisualStyleBackColor = true;
//
// radioButton3
//
this.radioButton3.AutoSize = true;
this.radioButton3.Location = new System.Drawing.Point(19, 65);
this.radioButton3.Name = "radioButton3";
this.radioButton3.Size = new System.Drawing.Size(130, 17);
this.radioButton3.TabIndex = 2;
this.radioButton3.TabStop = true;
this.radioButton3.Text = "Full Synthetic ($20.00)";
this.radioButton3.UseVisualStyleBackColor = true;
//
// Lube_job
//
this.Lube_job.AutoSize = true;
this.Lube_job.Location = new System.Drawing.Point(26, 175);
this.Lube_job.Name = "Lube_job";
this.Lube_job.Size = new System.Drawing.Size(109, 17);
this.Lube_job.TabIndex = 2;
this.Lube_job.Text = "Lube job ($18.00)";
this.Lube_job.UseVisualStyleBackColor = true;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.checkBox3);
this.groupBox3.Controls.Add(this.checkBox4);
this.groupBox3.Controls.Add(this.groupBox4);
this.groupBox3.Location = new System.Drawing.Point(-15, -54);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(200, 212);
this.groupBox3.TabIndex = 3;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Oil and Lube";
//
// checkBox3
//
this.checkBox3.AutoSize = true;
this.checkBox3.Location = new System.Drawing.Point(26, 175);
this.checkBox3.Name = "checkBox3";
this.checkBox3.Size = new System.Drawing.Size(109, 17);
this.checkBox3.TabIndex = 2;
this.checkBox3.Text = "Lube job ($18.00)";
this.checkBox3.UseVisualStyleBackColor = true;
//
// checkBox4
//
this.checkBox4.AutoSize = true;
this.checkBox4.Location = new System.Drawing.Point(24, 33);
this.checkBox4.Name = "checkBox4";
this.checkBox4.Size = new System.Drawing.Size(117, 17);
this.checkBox4.TabIndex = 1;
this.checkBox4.Text = "Oil Change($26.00)";
this.checkBox4.UseVisualStyleBackColor = true;
//
// groupBox4
//
this.groupBox4.Controls.Add(this.Full_Synthetic);
this.groupBox4.Controls.Add(this.Mixed);
this.groupBox4.Controls.Add(this.Regular);
this.groupBox4.Location = new System.Drawing.Point(15, 56);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(170, 105);
this.groupBox4.TabIndex = 0;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Oil type";
//
// Full_Synthetic
//
this.Full_Synthetic.AutoSize = true;
this.Full_Synthetic.Location = new System.Drawing.Point(19, 65);
this.Full_Synthetic.Name = "Full_Synthetic";
this.Full_Synthetic.Size = new System.Drawing.Size(130, 17);
this.Full_Synthetic.TabIndex = 2;
this.Full_Synthetic.TabStop = true;
this.Full_Synthetic.Text = "Full Synthetic ($20.00)";
this.Full_Synthetic.UseVisualStyleBackColor = true;
//
// Mixed
//
this.Mixed.AutoSize = true;
this.Mixed.Location = new System.Drawing.Point(19, 43);
this.Mixed.Name = "Mixed";
this.Mixed.Size = new System.Drawing.Size(92, 17);
this.Mixed.TabIndex = 1;
this.Mixed.TabStop = true;
this.Mixed.Text = "Mixed($10.00)";
this.Mixed.UseVisualStyleBackColor = true;
//
// Regular
//
this.Regular.AutoSize = true;
this.Regular.Location = new System.Drawing.Point(19, 20);
this.Regular.Name = "Regular";
this.Regular.Size = new System.Drawing.Size(89, 17);
this.Regular.TabIndex = 0;
this.Regular.TabStop = true;
this.Regular.Text = "Regular($0.0)";
this.Regular.UseVisualStyleBackColor = true;
//
// groupBox5
//
this.groupBox5.Controls.Add(this.Premium);
this.groupBox5.Controls.Add(this.Full_Service);
this.groupBox5.Controls.Add(this.Complemetary);
this.groupBox5.Controls.Add(this.CarWash_None);
this.groupBox5.Location = new System.Drawing.Point(251, 23);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(170, 116);
this.groupBox5.TabIndex = 2;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "Car wash";
//
// Full_Service
//
this.Full_Service.AutoSize = true;
this.Full_Service.Location = new System.Drawing.Point(19, 65);
this.Full_Service.Name = "Full_Service";
this.Full_Service.Size = new System.Drawing.Size(116, 17);
this.Full_Service.TabIndex = 2;
this.Full_Service.TabStop = true;
this.Full_Service.Text = "Full Service ($6.00)";
this.Full_Service.UseVisualStyleBackColor = true;
//
// Complemetary
//
this.Complemetary.AutoSize = true;
this.Complemetary.Location = new System.Drawing.Point(19, 43);
this.Complemetary.Name = "Complemetary";
this.Complemetary.Size = new System.Drawing.Size(133, 17);
this.Complemetary.TabIndex = 1;
this.Complemetary.TabStop = true;
this.Complemetary.Text = "Complementary ($0.00)";
this.Complemetary.UseVisualStyleBackColor = true;
//
// CarWash_None
//
this.CarWash_None.AutoSize = true;
this.CarWash_None.Location = new System.Drawing.Point(19, 20);
this.CarWash_None.Name = "CarWash_None";
this.CarWash_None.Size = new System.Drawing.Size(81, 17);
this.CarWash_None.TabIndex = 0;
this.CarWash_None.TabStop = true;
this.CarWash_None.Text = "None ($0.0)";
this.CarWash_None.UseVisualStyleBackColor = true;
//
// Premium
//
this.Premium.AutoSize = true;
this.Premium.Location = new System.Drawing.Point(20, 87);
this.Premium.Name = "Premium";
this.Premium.Size = new System.Drawing.Size(101, 17);
this.Premium.TabIndex = 3;
this.Premium.TabStop = true;
this.Premium.Text = "Premium ($9.00)";
this.Premium.UseVisualStyleBackColor = true;
//
// groupBox6
//
this.groupBox6.Controls.Add(this.Transmission_flush);
this.groupBox6.Controls.Add(this.Radiator_flush);
this.groupBox6.Location = new System.Drawing.Point(251, 145);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(170, 88);
this.groupBox6.TabIndex = 3;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "Flushes";
//
// Radiator_flush
//
this.Radiator_flush.AutoSize = true;
this.Radiator_flush.Location = new System.Drawing.Point(13, 31);
this.Radiator_flush.Name = "Radiator_flush";
this.Radiator_flush.Size = new System.Drawing.Size(133, 17);
this.Radiator_flush.TabIndex = 3;
this.Radiator_flush.Text = "Radiator flush ($30.00)";
this.Radiator_flush.UseVisualStyleBackColor = true;
//
// Transmission_flush
//
this.Transmission_flush.AutoSize = true;
this.Transmission_flush.Location = new System.Drawing.Point(13, 52);
this.Transmission_flush.Name = "Transmission_flush";
this.Transmission_flush.Size = new System.Drawing.Size(157, 17);
this.Transmission_flush.TabIndex = 4;
this.Transmission_flush.Text = "Transmission flush ($80..00)";
this.Transmission_flush.UseVisualStyleBackColor = true;
//
// groupBox7
//
this.groupBox7.Controls.Add(this.Inspection);
this.groupBox7.Controls.Add(this.Tire_rotation);
this.groupBox7.Controls.Add(this.Replace_Muffler);
this.groupBox7.Location = new System.Drawing.Point(25, 251);
this.groupBox7.Name = "groupBox7";
this.groupBox7.Size = new System.Drawing.Size(200, 88);
this.groupBox7.TabIndex = 4;
this.groupBox7.TabStop = false;
this.groupBox7.Text = "Misc";
//
// Tire_rotation
//
this.Tire_rotation.AutoSize = true;
this.Tire_rotation.Location = new System.Drawing.Point(14, 61);
this.Tire_rotation.Name = "Tire_rotation";
this.Tire_rotation.Size = new System.Drawing.Size(127, 17);
this.Tire_rotation.TabIndex = 4;
this.Tire_rotation.Text = "Tire rotation ($20..00)";
this.Tire_rotation.UseVisualStyleBackColor = true;
//
// Replace_Muffler
//
this.Replace_Muffler.AutoSize = true;
this.Replace_Muffler.Location = new System.Drawing.Point(14, 41);
this.Replace_Muffler.Name = "Replace_Muffler";
this.Replace_Muffler.Size = new System.Drawing.Size(148, 17);
this.Replace_Muffler.TabIndex = 3;
this.Replace_Muffler.Text = "Replace muffler ($100.00)";
this.Replace_Muffler.UseVisualStyleBackColor = true;
//
// Inspection
//
this.Inspection.AutoSize = true;
this.Inspection.Location = new System.Drawing.Point(14, 21);
this.Inspection.Name = "Inspection";
this.Inspection.Size = new System.Drawing.Size(117, 17);
this.Inspection.TabIndex = 5;
this.Inspection.Text = "Inspection ($15.00)";
this.Inspection.UseVisualStyleBackColor = true;
//
// groupBox8
//
this.groupBox8.Controls.Add(this.label2);
this.groupBox8.Controls.Add(this.label1);
this.groupBox8.Controls.Add(this.Labour_hrs);
this.groupBox8.Controls.Add(this.Parts_cost);
this.groupBox8.Location = new System.Drawing.Point(251, 251);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Size = new System.Drawing.Size(170, 88);
this.groupBox8.TabIndex = 5;
this.groupBox8.TabStop = false;
this.groupBox8.Text = "Parts and labour";
//
// Parts_cost
//
this.Parts_cost.Location = new System.Drawing.Point(84, 28);
this.Parts_cost.Name = "Parts_cost";
this.Parts_cost.Size = new System.Drawing.Size(62, 20);
this.Parts_cost.TabIndex = 0;
//
// Labour_hrs
//
this.Labour_hrs.Location = new System.Drawing.Point(85, 56);
this.Labour_hrs.Name = "Labour_hrs";
this.Labour_hrs.Size = new System.Drawing.Size(61, 20);
this.Labour_hrs.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 31);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(46, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Parts $$";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(14, 59);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(60, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Labour(hrs)";
//
// groupBox9
//
this.groupBox9.Controls.Add(this.label5);
this.groupBox9.Controls.Add(this.label6);
this.groupBox9.Controls.Add(this.Total);
this.groupBox9.Controls.Add(this.Tax);
this.groupBox9.Controls.Add(this.label3);
this.groupBox9.Controls.Add(this.label4);
this.groupBox9.Controls.Add(this.Parts);
this.groupBox9.Controls.Add(this.Service_cost);
this.groupBox9.Location = new System.Drawing.Point(25, 345);
this.groupBox9.Name = "groupBox9";
this.groupBox9.Size = new System.Drawing.Size(396, 139);
this.groupBox9.TabIndex = 6;
this.groupBox9.TabStop = false;
this.groupBox9.Text = "Summary";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(15, 45);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(31, 13);
this.label3.TabIndex = 3;
this.label3.Text = "Parts";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(13, 21);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(90, 13);
this.label4.TabIndex = 2;
this.label4.Text = "Service and labor";
//
// Parts
//
this.Parts.Enabled = false;
this.Parts.Location = new System.Drawing.Point(141, 42);
this.Parts.Name = "Parts";
this.Parts.Size = new System.Drawing.Size(114, 20);
this.Parts.TabIndex = 1;
//
// Service_cost
//
this.Service_cost.Enabled = false;
this.Service_cost.Location = new System.Drawing.Point(141, 18);
this.Service_cost.Name = "Service_cost";
this.Service_cost.Size = new System.Drawing.Size(116, 20);
this.Service_cost.TabIndex = 0;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(17, 93);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(73, 13);
this.label5.TabIndex = 7;
this.label5.Text = "Total Charges";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(16, 69);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(66, 13);
this.label6.TabIndex = 6;
this.label6.Text = "Tax on parts";
//
// Total
//
this.Total.Enabled = false;
this.Total.Location = new System.Drawing.Point(143, 90);
this.Total.Name = "Total";
this.Total.Size = new System.Drawing.Size(112, 20);
this.Total.TabIndex = 5;
//
// Tax
//
this.Tax.Enabled = false;
this.Tax.Location = new System.Drawing.Point(142, 66);
this.Tax.Name = "Tax";
this.Tax.Size = new System.Drawing.Size(113, 20);
this.Tax.TabIndex = 4;
//
// Calculate
//
this.Calculate.Location = new System.Drawing.Point(81, 492);
this.Calculate.Name = "Calculate";
this.Calculate.Size = new System.Drawing.Size(75, 23);
this.Calculate.TabIndex = 7;
this.Calculate.Text = "Calculate";
this.Calculate.UseVisualStyleBackColor = true;
this.Calculate.Click += new System.EventHandler(this.Calculate_Click);
//
// Clear
//
this.Clear.Location = new System.Drawing.Point(179, 492);
this.Clear.Name = "Clear";
this.Clear.Size = new System.Drawing.Size(75, 23);
this.Clear.TabIndex = 8;
this.Clear.Text = "Clear";
this.Clear.UseVisualStyleBackColor = true;
this.Clear.Click += new System.EventHandler(this.Clear_Click);
//
// Exit
//
this.Exit.Location = new System.Drawing.Point(276, 492);
this.Exit.Name = "Exit";
this.Exit.Size = new System.Drawing.Size(75, 23);
this.Exit.TabIndex = 9;
this.Exit.Text = "Exit";
this.Exit.UseVisualStyleBackColor = true;
this.Exit.Click += new System.EventHandler(this.Exit_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(436, 527);
this.Controls.Add(this.Exit);
this.Controls.Add(this.Clear);
this.Controls.Add(this.Calculate);
this.Controls.Add(this.groupBox9);
this.Controls.Add(this.groupBox8);
this.Controls.Add(this.groupBox7);
this.Controls.Add(this.groupBox6);
this.Controls.Add(this.groupBox5);
this.Controls.Add(this.groupBox1);
this.Name = "Form1";
this.Text = "Automotive Shop";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
this.groupBox7.ResumeLayout(false);
this.groupBox7.PerformLayout();
this.groupBox8.ResumeLayout(false);
this.groupBox8.PerformLayout();
this.groupBox9.ResumeLayout(false);
this.groupBox9.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.CheckBox Lube_job;
private System.Windows.Forms.CheckBox Oil_Change;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.CheckBox checkBox3;
private System.Windows.Forms.CheckBox checkBox4;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.RadioButton Full_Synthetic;
private System.Windows.Forms.RadioButton Mixed;
private System.Windows.Forms.RadioButton Regular;
private System.Windows.Forms.RadioButton radioButton3;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.RadioButton Premium;
private System.Windows.Forms.RadioButton Full_Service;
private System.Windows.Forms.RadioButton Complemetary;
private System.Windows.Forms.RadioButton CarWash_None;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.CheckBox Transmission_flush;
private System.Windows.Forms.CheckBox Radiator_flush;
private System.Windows.Forms.GroupBox groupBox7;
private System.Windows.Forms.CheckBox Inspection;
private System.Windows.Forms.CheckBox Tire_rotation;
private System.Windows.Forms.CheckBox Replace_Muffler;
private System.Windows.Forms.GroupBox groupBox8;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox Labour_hrs;
private System.Windows.Forms.TextBox Parts_cost;
private System.Windows.Forms.GroupBox groupBox9;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox Total;
private System.Windows.Forms.TextBox Tax;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox Parts;
private System.Windows.Forms.TextBox Service_cost;
private System.Windows.Forms.Button Calculate;
private System.Windows.Forms.Button Clear;
private System.Windows.Forms.Button Exit;
}
}
--------------------------------------------
Form1.cs
------------------------------------------
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 Automotive_Shop
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Calculate_Click(object sender, EventArgs e)
{
int serviceCost = 0;
double partsCost = 0.0;
int oilCost = 0, carwashCost = 0, flushesCost = 0, miscCost = 0, partsLaborCost = 0;
double taxPercent = 10.5;
double total = 0.0;
//------------------------------------------------
//Oil and lube group
if (Oil_Change.Checked==true)
{
if(Regular.Checked==true)
{
oilCost = oilCost + 26 + 0;
}
else if(Mixed.Checked==true)
{
oilCost = oilCost + 26 + 10;
}
else if(Full_Synthetic.Checked==true)
{
oilCost = oilCost + 26 + 20;
}
else
{
oilCost = oilCost + 26;
}
}
if(Lube_job.Checked==true)
{
oilCost = oilCost + 18;
}
//-----------------------------------------------------
//Car wash group
if(CarWash_None.Checked==true)
{
carwashCost = carwashCost + 0;
}
else if(Complemetary.Checked==true)
{
carwashCost = carwashCost + 0;
}
else if(Full_Service.Checked==true)
{
carwashCost = carwashCost + 6;
}
else if(Premium.Checked==true)
{
carwashCost = carwashCost + 9;
}
//--------------------------------------------
//Misc group
if(Inspection.Checked==true)
{
miscCost = miscCost + 15;
}
if(Replace_Muffler.Checked == true)
{
miscCost = miscCost + 100;
}
if(Tire_rotation.Checked == true)
{
miscCost = miscCost + 20;
}
//----------------------------------------------
//Flushes group
if (Radiator_flush.Checked == true)
{
flushesCost = flushesCost + 30;
}
if (Transmission_flush.Checked == true)
{
flushesCost = flushesCost + 80;
}
//------------------------------------------------
//Parts and labor group
if(Parts_cost.Text!="")
{
partsLaborCost = partsLaborCost + Convert.ToInt32(Parts_cost.Text);
}
if (Labour_hrs.Text != "")
{
partsLaborCost = partsLaborCost + (Convert.ToInt32(Labour_hrs.Text) * 20);
}
//-------------------------------------------------
//Summary group
Service_cost.Text = (flushesCost + oilCost + carwashCost + miscCost).ToString();
if(Parts_cost.Text!="")
{
Tax.Text = (Convert.ToInt32(Parts_cost.Text) * (taxPercent / 100)).ToString();
Total.Text = (oilCost + flushesCost + miscCost + carwashCost + partsLaborCost + (Convert.ToInt32(Parts_cost.Text) * (taxPercent / 100))).ToString();
Parts.Text = Parts_cost.Text;
}
else
{
Parts.Text = "";
Tax.Text = "";
Total.Text = (oilCost + flushesCost + miscCost + carwashCost + partsLaborCost).ToString();
}
}
private void Clear_Click(object sender, EventArgs e)
{
//reset all the controls
Oil_Change.Checked = false;
Regular.Checked =false;
Mixed.Checked = false;
Full_Synthetic.Checked = false;
Transmission_flush.Checked = false;
Replace_Muffler.Checked = false;
Parts_cost.Text = "";
Parts.Text = "";
Radiator_flush.Checked = false;
Lube_job.Checked = false;
CarWash_None.Checked = false;
Complemetary.Checked = false;
Premium.Checked = false;
Full_Service.Checked = false;
Labour_hrs.Text = "";
Tire_rotation.Checked = false;
Inspection.Checked = false;
Total.Text = "";
Service_cost.Text = "";
Tax.Text = "";
}
private void Exit_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.