my code is not working, can you tell me how to correct it please. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using...


my code is not working, can you tell me how to correct it please.


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 Final
{
public partial class Form1 : Form
{


static int count1 = 0, count2 = 0, count3 = 0, car1Sale = 0, car2Sale = 0, car3Sale = 0;
public Form1()
{
InitializeComponent();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
chkPanel1();
textBox4.Text = Convert.ToString(count1 + count2 + count3);
saleCalulate();


}
private void checkBox14_CheckedChanged(object sender, EventArgs e)
{
chkPanel2();
textBox4.Text = Convert.ToString(count1 + count2 + count3);
saleCalulate();
}
private void button2_Click(object sender, EventArgs e)
{
foreach (Control cBox in this.panel1.Controls)
{
if (cBox is CheckBox)
{
((CheckBox)cBox).Checked = false;
}
}
foreach (Control cBox in this.panel2.Controls)
{
if (cBox is CheckBox)
{
((CheckBox)cBox).Checked = false;
}
}
foreach (Control cBox in this.panel3.Controls)
{
if (cBox is CheckBox)
{
((CheckBox)cBox).Checked = false;
}
}
clearAvailable();
}
private void chkPanel1()
{
clearAvailable();
count1 = 0;
foreach (Control c in this.panel1.Controls)
{
if (c is CheckBox)
{
if (((CheckBox)c).Checked)
{
count1++;
textBox1.Text = count1.ToString();
}
}
}
}
private void clearAvailable()
{
textBox10.Text = "";
textBox11.Text = "";
textBox12.Text = "";
textBox9.Text = "";
}
private void chkPanel2()
{
clearAvailable();
count2 = 0;
foreach (Control c in this.panel2.Controls)
{
if (c is CheckBox)
{
if (((CheckBox)c).Checked)
{
count2++;
textBox2.Text = count2.ToString();
}
}
}
}
private void chkPanel3()
{
clearAvailable();
count3 = 0;
foreach (Control c in this.panel3.Controls)
{
if (c is CheckBox)
{
if (((CheckBox)c).Checked)
{
count3++;
textBox3.Text = count3.ToString();
}
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
chkPanel1();
chkPanel2();
chkPanel3();
textBox4.Text = Convert.ToString(count1 + count2 + count3);
saleCalulate();
}


private void saleCalulate()
{
car1Sale = count1 * 300;
car2Sale = count2 * 200;
car3Sale = count3 * 100;
textBox5.Text = "$" + car1Sale;
textBox6.Text = "$" + car2Sale;
textBox7.Text = "$" + car3Sale;
textBox8.Text = "$" + Convert.ToString(car1Sale + car2Sale + car3Sale);
}
private void checkBox40_CheckedChanged(object sender, EventArgs e)
{
chkPanel3();
textBox4.Text = Convert.ToString(count1 + count2 + count3);
saleCalulate();
}
private void button1_Click(object sender, EventArgs e)
{
textBox9.Text = Convert.ToString(50 - (count1 + count2 + count3));
textBox10.Text = (10 - count1).ToString();
textBox11.Text = (20 - count2).ToString();
textBox12.Text = (20 - count3).ToString();
}
}
}


o! Form1<br>CAR #1<br>groupBox2<br>CAR #3<br>A<br>B<br>Purchase infomation<br>1<br>SEATS TO PURCHASE<br>CAR #1:<br>CAR #2:<br>4<br>CAR #3:<br>Total seats to purchase: o<br>CAR #2<br>SE<br>PRICE<br>groupBox3<br>CAR #1 A D<br>$300<br>SEAT SALES:<br>CAR #1:<br>CAR #2<br>$200<br>2<br>CAR #2:<br>CAR #3 A В СD $100<br>CAR #3:<br>Total Sales:<br>5<br>Purchase<br>Clear<br>Seat infomation:<br>SEATS AVAILABLE/TOTAL:<br>TOTAL SEATS:<br>/50<br>CAR #1:<br>/10<br>CAR #2:<br>/20<br>CAR #3:<br>/20<br>3.<br>LO<br>

Extracted text: o! Form1 CAR #1 groupBox2 CAR #3 A B Purchase infomation 1 SEATS TO PURCHASE CAR #1: CAR #2: 4 CAR #3: Total seats to purchase: o CAR #2 SE PRICE groupBox3 CAR #1 A D $300 SEAT SALES: CAR #1: CAR #2 $200 2 CAR #2: CAR #3 A В СD $100 CAR #3: Total Sales: 5 Purchase Clear Seat infomation: SEATS AVAILABLE/TOTAL: TOTAL SEATS: /50 CAR #1: /10 CAR #2: /20 CAR #3: /20 3. LO
Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here