I know I'm missing something bigtime C# Beginner

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 3378 Views - Last Post: 21 December 2013 - 09:55 AM Rate Topic: -----

#1 littlebeauty4u   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 09-December 13

I know I'm missing something bigtime C# Beginner

Posted 19 December 2013 - 07:51 PM

Here is my code and my build errors, new student and I don't understand why I'm getting this. I've looked at other code but I'm just not getting what I'm missing. Can someone give me a short example in my code so I can see. Please. I'm not sure how to insert this in a code tag???? Thanks Thanks, Angie




Error 1 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 31 11 WindowsFormsApplication5
Error 2 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 32 18 WindowsFormsApplication5
Error 3 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 33 18 WindowsFormsApplication5
Error 4 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 34 18 WindowsFormsApplication5
Error 5 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 35 18 WindowsFormsApplication5
Error 6 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 36 18 WindowsFormsApplication5
Error 7 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 37 18 WindowsFormsApplication5
Error 8 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 38 18 WindowsFormsApplication5
Error 9 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 39 18 WindowsFormsApplication5
Error 10 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 40 18 WindowsFormsApplication5
Error 11 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 41 18 WindowsFormsApplication5
Error 12 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 42 18 WindowsFormsApplication5
Error 13 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 43 18 WindowsFormsApplication5
Error 14 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 44 18 WindowsFormsApplication5
Error 15 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 45 18 WindowsFormsApplication5
Error 16 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 46 18 WindowsFormsApplication5
Error 17 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 47 18 WindowsFormsApplication5
Error 18 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 48 18 WindowsFormsApplication5
Error 19 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 49 18 WindowsFormsApplication5
Error 20 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 50 11 WindowsFormsApplication5
Error 21 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 51 11 WindowsFormsApplication5
Error 22 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 55 12 WindowsFormsApplication5
Error 23 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 59 14 WindowsFormsApplication5
Error 24 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 115 8 WindowsFormsApplication5
Error 25 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 120 9 WindowsFormsApplication5
Error 26 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 128 9 WindowsFormsApplication5
Error 27 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 290 9 WindowsFormsApplication5
Error 28 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 362 9 WindowsFormsApplication5
Error 29 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 367 9 WindowsFormsApplication5
Error 30 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 379 9 WindowsFormsApplication5
Error 31 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 391 9 WindowsFormsApplication5
Error 32 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 404 9 WindowsFormsApplication5
Error 33 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 410 9 WindowsFormsApplication5
Error 34 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 415 9 WindowsFormsApplication5
Error 35 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 422 9 WindowsFormsApplication5
Error 36 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 457 9 WindowsFormsApplication5
Error 37 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 660 9 WindowsFormsApplication5
Error 38 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 676 9 WindowsFormsApplication5
Error 39 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 692 9 WindowsFormsApplication5
Error 40 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 707 9 WindowsFormsApplication5
Error 41 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 723 9 WindowsFormsApplication5
Error 42 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 739 9 WindowsFormsApplication5
Error 43 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 755 9 WindowsFormsApplication5
Error 44 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 771 9 WindowsFormsApplication5
Error 45 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 787 9 WindowsFormsApplication5
Error 46 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 803 9 WindowsFormsApplication5
Error 47 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 819 9 WindowsFormsApplication5
Error 48 Expected class, delegate, enum, interface, or struct c:\users\james\documents\visual studio 2013\Projects\WindowsFormsApplicationAPizzeria Test\WindowsFormsApplication5\Form1.cs 835 9 WindowsFormsApplication5



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 WindowsFormsApplication5
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
    }
}
/* mod edit: removed personal information/

	 private Void label2 = null;
         private String lable3 = null;
         private String label4 = null; 
         private String label5 = null;
         private String label5 = null;
         private String label6 = null;
         private String label1 = null;
         private String label7 = null;
         private String label8 = null;
         private String label9 = null;
         private String labe10 = null;
         private String label11 = null;
         private String labe12 = null;
         private String label13 = null;
         private String label14 = null;
         private String labe115 = null;
         private String label16 = null;
         private String SubTotal = null;
         private String label18 = null;
	 private String label19 = null;
	 private String label20 = null;

         

		 private String PizzaPrice = "";



	    private String menu = null;
            const double TAX_RATE = 4.000;
            const double Small = 3.00;
            const double MEdium = 5.00;
            const double Large = 8.00;
            const double Thin = 1.00;
            const double Thick = 2.00;
            const double Stuffed = 4.00;
            const double Original = 1.00;
            const double Spicy = 3.00;
            const double Pepperoni = 0.50;
            const double Cheese = 0.50;
            const double Sausage = 1.25;
            const double GrOlives = 0.75;
            const double Onions = 0.45;
            const double Ham = 0.85;
            const double BlOlives = 0.90;
            const double Bread = 2.00;
            const double Wings = 4.50;
            const double Sticks = 3.00;
            const double Coke = 1.50;
            const double Tea = 1.25;
            const double Water = 1.00;
            const double topping = 0.00;
            const double others = 0.00;
            double total;



            textBox1.Text = null;
            textBox2.Text = null;
            textBox3.Text = null;
            textBox4.Text = null;
            DNP.Checked = false;
            SRVName.Checked = false;
            PizzaSize.Checked = false;
            PizzaCrust.Checked = false;
            PizzaSauce.Checked = false;
            CheckedListBox1.Checked = false;
            CheckedListBox2.Checked = false;
            CheckedListBox3.Checked = false;
            checkedListBox4.Checked = false;
            QuantityToppings.Checked = false;
            QuantitySides.checked = false;
            QuantityDrinks.Checked = false;
            OrdNum.Checked = false;
            PizzaTot.Checked = false;
            SideTot.Checked = false;
            DrinksTot.Checked = false;
            SubTotal.Checked = false;
            Tax.Checked = false;
            Total.Checked = false;
            Finish.Checked = false;
            NextOrd.Checked = false;
    
    		
public form1()
{
InitializeCoponent();
{

private void ComboBox_Selectionchanged(object sender, SelectionchangedEventArgs e)
{
       DNB = Dine In.Text;
       DNB = Carry Out.Text;
       DNB = Delivery.Text;
}


private void CalculatePizzaorder ()
{
    //Calculate the order

   double dblpizzaPrice - 0.00;

  if (PizzaSize.checked)
{

dblpizzaprice = 8.00;

}



    if (PizzaSize.Checked)
    {

        dblPizzaPrice = 5.00;

    }



    if (PizzaSize.Checked)
    {

        dblPizzaPrice = 3.00;

    }



    if (checkedListBox1.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + .85;

    }



    if (checkedListBox1.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + .45;

    }



    if (checkedListBox1.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + .50;

    }



    if (checkedListBox1.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + .50;

    }



    if (checkedListBox1.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + 1.25;

    }



    if (checkedListBox1.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + 0.90;

    }

    if (checkedListBox1.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + 0.75;

    }

    if (PizzaCrust.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + 1.00;

    }

    if (PizzaCrust.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + 2.00;

    }

    if (PizzaCrust.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + 4.00;

    }


    if (checkedListBox2.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + 2.00;

    }
    if (CheckedListbox2.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + 4.50;

    }
    if (CheckedListbox2.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + 3.00;

    }
    if (checkedListBox3.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + 1.50;

    }
    if (CheckedListBox3.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + 1.25;

    }
    if (CheckedListBox3.Checked)
    {

        dblPizzaPrice = dblPizzaPrice + 1.00;

    }

    


    PizzaPrice = (dblPizzaPrice*1.04).ToString();


    


}

private void Finished_Click_1(object sender, EventArgs e)
{
   
    //receipt to customer


    String name = CustName.Text;
    String address = CustAddy.Text;
    String ZipCode = ZipCode.text;
    String dining = DNP.Text;
    String table = TblNum.Text;
    String server = SRVName.Text;
    String date = dateTimePicker2.Text;
    String Pizza = PizzaSize.Text;
    String Sides = PizzaSide.Text;
    String Drinks = PizzaDrinks.Text;
    String SubTotal = SubTL.text
    string Tax = Tax.test
    String Total = Total.Text;
    String payment = checkListbox4.Text;

    and place order receipt to kitchen;           


 


   String name = CustName.Txt;9  
   String TableNumber = TBLNum;
   String DNP = DNP.Text;
   String SRVName = SRVName.Text;
   String PizzaSize = PizzaSize.Text;   ( Could not figure out how to distinguish combobox items) 
   String PizzaCrust = PizzaCrust.Text;
   String PizzaSauce = PizzaSauce.Text;
   String PizzaToppings = CheckedListbox1. "Pepperoni", "Sausage", "Ham", "BlOlives", "GROlives", "Onions", "Cheese"
   String PizzaSides = CheckedListBox2. "Bread Sticks", "Chicken Wings", Cinnamon Sticks
   String PizzaDrinks = CheckedListBox3. "Coke", "Sprite", "Ice Tea", "Water"

}

Public Void NextOrder_Click_1(Object Sender, EventArgs e)
{

   String name = CustName.Txt;
   String TableNumber = TBLNum;
   String DNP = DNP.Text;
   String SRVName = SRVName.Text;
   String PizzaSize = PizzaSize.Text;   ( Could not figure out how to distinguish combobox items) 
   String PizzaCrust = PizzaCrust.Text;
   String PizzaSauce = PizzaSauce.Text;
   String PizzaToppings = CheckedListbox1. "Pepperoni", "Sausage", "Ham", "BlOlives", "GROlives", "Onions", "Cheese"
   String PizzaSides = CheckedListBox2. "Bread Sticks", "Chicken Wings", Cinnamon Sticks;
   String PizzaDrinks = CheckedListBox3. "Coke", "Sprite", "Ice Tea", "Water"

 

    CalculatePizzaOrder(); ;


    MessageBox.Show("\nCustName: " + Name + 
        "\nSRVName taking order: " + SRVName + server +
        "\nDate and Time: " + date +
        "\nCustAddress"nAddress:  
        "\nDining Preference: " + dining + 
        "\nMenu: " + menu + "\nAdditions:" +  
        "\nCrust:" + PizzaCrust + PizzaCrust + PizzaCrust + "\nSauce:" + PizzaSauce + PizzaSauce + "\nSides:" + PizzaSides + PizzaSides + PizzaSides +
        "\nDrinks:" + CheckedListBox3 + checkedListBox3 + checkedListBox3+ CheckedListbox3 "\nPayment Method: " + CheckedListBox4 + payment + "\nTotal: " + PizzaPrice, "Finish Your Order!",


 MessageBoxButtons., MessageBoxIcon.Information);
}

private void Finished_Click_1(object sender, EventArgs e)
{
    Application.Exit(); 
}

private void checkBox1_CheckedChanged_1(object sender, EventArgs e)
{
    if (checkListBox1.Checked)
    {
        CheckListBox1 = " Ham";
    }
    else
    {
        CheckedListbox1 = null;
    }
}

private void checkBox1_CheckedChanged_1(object sender, EventArgs e)
{
    if (checkedListBox1.Checked)
    {
        checkedListBox1 = " Onions";
    }
    else
    {
        checkedListBox1 = null;
    }
}

private void checkedListBox1_CheckedChanged_1(object sender, EventArgs e)
{
    if (checkedListBox1.Checked)
    {
        CheckedListBox1 = " Cheese";
    }
    else
    {
        CheckedListBox1 = null;
    }
}


private void PizzaSize_CheckedChanged_1(object sender, EventArgs e)
{
    menu = "Large";
    PizzaSizeCalc();
}

private void PizzaSize_CheckedChanged_1(object sender, EventArgs e)
{
    menu = "Medium";
}

private void PizzaSize_CheckedChanged_1(object sender, EventArgs e)
{
    menu = "Small";
}



private void PizzaSizeCalc()
{   

    if (PizzaSize.Checked == true)
    {

        total = 0.00;

        total = total + Large;

    }

    else if (PizzaSize.Checked == true)
    {

        total = 0.00;

        total = total + MEdium;

    }

    else if (PizzaSize.Checked == true)
    {

        total = 0.00;

        total = total + Small;

    }

    

}


private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
    if (checkListBox1.Checked)
    {
         CheckedListbox1 = " Pepperoni";
        total = total + Pepperoni;
    }
    else
    {
        checkedListbox1 = null;
        total = total - Pepperoni;
    }
}


{
    if (checkedListBox1.Checked)
    {
        CheckedListbox1 = " Sausage";
        total = total + Sausage;
    }
    else
    {
        CheckedListbox1 = null;
        total = total - Sausage;
    }


{
    if (checkListBox1.Checked)
    {
        Checkedlistbox1 = " Black Olives";
        total = total + BlOlives;
    }
    else
    {
        checkedListBox1 = null;
        total = total - BlOlives;
    }



{
    if (checkedListBox1.Checked)
    {
        CheckedListBox1 = " Green Olives";
        total = total + GrOlives;
    }
    else
    {
        CheckedListBox1 = null;
        total = total - GrOlives;
    }



{
    if (PizzaCrust.Checked)
    {
        PizzaCrust = " Thin";
        total = total + Thin;
    }
    else
    {
        PizzaCrust1 = null;
        total = total - Thin;
    }



{
    if (PizzaCrust.Checked)
    {
        PizzaCrust = " Thick";
        total = total + Thick;
    }
    else
    {
        PizzaCrust = null;
        total = total - Thick;
    }

{
    if (PizzaCrust.Checked)
    {
        PizzaCrust = " Stuffed";
        total = total + Stuffed;
    }
    else
    {
        PizzaCrust = null;
        total = total - Stuffed;
    }



{
    if (PizzaSauce.Checked)
    {
        PizzaSauce = " Original";
        total = total + Original;
    }
    else
    {
        PizzaSauce = null;
        total = total - Original;
    }

{
    if (PizzaSauce.Checked)
    {
        PizzaSauce = " Spicy";
        total = total + Spicy;
    }
    else
    {
        PizzaSauce = null;
        total = total - Spicy;

{
    if (checkedListBox3.Checked)
    {
        checkedListBox3 = " Coke or Sprite";
        total = total + Coke;

    }
    else
    {
        CheckedListbox3 = null;
        total = total - Coke;

    }

{
    if (checkedListbox3.Checked)
    {
        CheckedListbox3 = " Iced Tea";
        total = total + Tea;

    }
    else
    {
        checkedListbox3 = null;
        total = total - Tea;

    }

{
    if (CheckedListBox3.Checked)
    {
        checkedListbox3 = " Water";
        total = total + Water;

    }
    else
    {
        checkedListBox3 = null;
        total = total - Water;

    }

{
    if (checkedListBox2.Checked)
    {
        checkedListBox2 = " Bread Sticks";
        total = total + Bread;
    }
    else
    {
        checkedListBox2 = null;
        total = total - Bread;

    }

{
    if (checkedListBox2.Checked)
    {
        checkedListbox2 = " Chicken Wings";
        total = total + Wings;

    }
    else
    {
        checkedListbox2 = null;
        total = total - Wings;

    }

{
    if (checkedListbox2.Checked)
    {
        checkedListbox2 = " Cinnamon Sticks";
        total = total + Sticks;

    }
    else
    {
        checkedListbox2 = null;
        total = total - Sticks;

    }
}

private void checkedListbox4_CheckedChanged_1(object sender, EventArgs e)
{
    if (checkedListBox4.Checked)
    {
        CheckedListBox4 = " Cash";
        total = total + Sticks;

    }
    else
    {
        CheckedListBox4 = null;
        total = total - Sticks;

    }


private void checkedListBox4_CheckedChanged(object sender, EventArgs e)
{
    if (CheckedListBox4.Checked)
    {
        checkedListBox4 = " Credit";
        total = total + Sticks;

    }
    else
    {
        checkedListBox4 = null;
        total = total - Sticks;

    }


private void checkedListbox4_CheckedChanged_1(object sender, EventArgs e)
{
    if (checkedListBox4.Checked)
    {
        CheckedListBox4 = " Check";
        total = total + Sticks;

    }
    else
    {
        CheckedListBox4 = null;
        total = total - Sticks;

    }
}
private void SRVName_CheckedChanged(object sender, EventArgs e)
{
    if (SRVName.Checked)
    {
        SRVName = " Sarah";
        total = total + Sticks;

    }
    else
    {
        SRVName = null;
        total = total - Sticks;

    }
}

private void SRVName_CheckedChanged(object sender, EventArgs e)
{
    if (SRVName.Checked)
    {
        SRVName = " Tony";
        total = total + Sticks;

    }
    else
    {
        SRVName = null;
        total = total - Sticks;

    }
}

private void SRVName_CheckedChanged(object sender, EventArgs e)
{
    if (SRVName.Checked)
    {
        SRVName = " Gina";
        total = total + Sticks;

    }
    else
    {
        SRVName = null;
        total = total - Sticks;

    }
}

private void SRVName_CheckedChanged(object sender, EventArgs e)
{
    if (SRVName.Checked)
    {
        SRVName = " Jozepi";
        total = total + Sticks;

    }
    else
    {
        SRVName = null;
        total = total - Sticks;

    }
}

private void SRVName_CheckedChanged(object sender, EventArgs e)
{
    if (SRVName.Checked)
    {
        SRVName = " Louigi";
        total = total + Sticks;

    }
    else
    {
        SRVName = null;
        total = total - Sticks;

    }
}

private void SRVName_CheckedChanged(object sender, EventArgs e)
{
    if (SRVName.Checked)
    {
        SRVName = " Susan";
        total = total + Sticks;

    }
    else
    {
        SRVName = null;
        total = total - Sticks;

    }
}

private Void SRVName_CheckedChanged(object sender, EventArgs e)
{
    if (SRVName.Checked)
    {
        SRVName = "Ray";
        total = total + Sticks;

    }
    else
    {
        SRVName = null;
        total = total - Sticks;

    }
}

private void DNP_CheckedChanged(object sender, EventArgs e)
{
    if (DNP.Checked)
    {
        DNP = " Dine-in";
        total = total + Sticks;

    }
    else
    {
        DNP = null;
        total = total - Sticks;

    }
}

private void DNP_CheckedChanged(object sender, EventArgs e)
{
    if (DNP.Checked)
    {
       DNP = " Carry Out"
       Total = total + sticks;
}
  else
{  
       DNP = null
       total = total - sticks;

{
    if (DNP.checked)
}
        DNP =" Delivery";
        Total = total + sticks;
 

}

{			
			
			
			this.listBox1.SelectionMode = SelectionMode.MultiExtended;

 ....

           if (this.listBox1.Items.Count > 0)
        {
         this.listBox1.Focus();
         this.listBox1.SetSelected(0, true);
         SendKeys.Send("+{END}");
         }

		 
		 
		 
		 
		 
		 
    }
}



This post has been edited by Curtis Rutland: 20 December 2013 - 12:37 PM
Reason for edit:: highlight your text and click the 'code' button


Is This A Good Question/Topic? 0
  • +

Replies To: I know I'm missing something bigtime C# Beginner

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15260
  • View blog
  • Posts: 61,138
  • Joined: 12-June 08

Re: I know I'm missing something bigtime C# Beginner

Posted 19 December 2013 - 08:22 PM

115	public form1()
116	{
117	InitializeCoponent();
118	{

Notice something odd with the open and close brackets? Like you have two open but no close?

You're missing a ton of closed brackets through out your code.

Remember:

Spoiler

Was This Post Helpful? 0
  • +
  • -

#3 littlebeauty4u   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 09-December 13

Re: I know I'm missing something bigtime C# Beginner

Posted 19 December 2013 - 08:29 PM

why isn't the compiler showing me those errors??? I give up.... to much anxiety to learn this in a week.... oh well thanks for your help anyway, but don't be surprised if I'm not back on here posting examples of code. I did cobol and rpg back in the day and it took me two school years to learn it well, I like this just going to take me a few to catch on!
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15260
  • View blog
  • Posts: 61,138
  • Joined: 12-June 08

Re: I know I'm missing something bigtime C# Beginner

Posted 19 December 2013 - 08:36 PM

That's what the IDE is saying.. it doesn't know where the class, methods, etc start and end because you have the braces all jacked up.
Was This Post Helpful? 1
  • +
  • -

#5 littlebeauty4u   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 09-December 13

Re: I know I'm missing something bigtime C# Beginner

Posted 19 December 2013 - 08:44 PM

impossible! Fixed those and I'm down to three errors. LOL WOW....
Can anyone give me an example of checkedlistbox if I have three choices in there for a user to pick.

How do you put this in that format to show the code??

do I start with what I want it to do? or selectedIndexchange. something?

private void DNP_SelectedIndexChanged(object sender, EventArgs e)
{

{
}
{

private void DNP_SelectedIndexChanged(object sender, EventArgs e)
        {
        
        }
    }
}


I'm a dork! Got the code tag.
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15260
  • View blog
  • Posts: 61,138
  • Joined: 12-June 08

Re: I know I'm missing something bigtime C# Beginner

Posted 19 December 2013 - 08:46 PM

Quote

Can anyone give me an example of checkedlistbox if I have three choices in there for a user to pick.

How do you put this in that format to show the code??

Drag on from your toolbox into your form in the designer mode.
Was This Post Helpful? 0
  • +
  • -

#7 littlebeauty4u   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 09-December 13

Re: I know I'm missing something bigtime C# Beginner

Posted 19 December 2013 - 09:03 PM

I've got the whole form built. I'm just having trouble understanding how I'm suppose to write the code for the combo and checkedListboxes. I'm starting in the middle instead of the beginning, but not my fault, I thought this was a beginner class and bam I'm writing all this complicated code and I've never even looked at the console before in my life, took me a week to figure that out. My form looks great, got all the logic of the app just missing on how to write. Waste of money I'm not happy about that, but what do you do?
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15260
  • View blog
  • Posts: 61,138
  • Joined: 12-June 08

Re: I know I'm missing something bigtime C# Beginner

Posted 19 December 2013 - 09:18 PM

Quote

I'm not happy about that, but what do you do?

... back track when not in class on the areas you missed?
Was This Post Helpful? 0
  • +
  • -

#9 littlebeauty4u   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 09-December 13

Re: I know I'm missing something bigtime C# Beginner

Posted 19 December 2013 - 09:42 PM

where are my brackets off. I can't see it. Down to three!

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 OMG
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
    

    }


}


/* mod edit: removed personal information */

}

{

}

}
	 private String label2 = null;
         private String lable3 = null;
         private String label4 = null; 
         private String label5 = null;
         private String label5 = null;
         private String label6 = null;
         private String label1 = null;
         private String label7 = null;
         private String label8 = null;
         private String label9 = null;
         private String labe10 = null;
         private String label11 = null;
         private String labe12 = null;
         private String label13 = null;
         private String label14 = null;
         private String labe115 = null;
         private String label16 = null;
         private String SubTotal = null;
         private String label18 = null;
	     private String label19 = null;
	     private String label20 = null;
}

{

}

{

}
         

		 private String PizzaPrice = "";


ohhh no I'm going to backtrack... I'm going to start over. LOL, so I know what the heck I'm doing. then I'm going to write an awesome application and try and test out! They want a logic program with loops, arrays, and calculations and print screens, and text files.

This post has been edited by Curtis Rutland: 20 December 2013 - 12:36 PM

Was This Post Helpful? 0
  • +
  • -

#10 littlebeauty4u   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 09-December 13

Re: I know I'm missing something bigtime C# Beginner

Posted 19 December 2013 - 09:55 PM

hey guys ...appreciate the help. You took some of the aniexty away even thought the compiler ran and my app came up nothing worked as far as the calculation and all the other stuff. oh well.... you could fill in fields, but no calculation. Each Failure turns to greatness.
Was This Post Helpful? 0
  • +
  • -

#11 Michael26   User is offline

  • Futurama: Insert funny joke here
  • member icon

Reputation: 414
  • View blog
  • Posts: 1,664
  • Joined: 08-April 09

Re: I know I'm missing something bigtime C# Beginner

Posted 20 December 2013 - 05:52 AM

Little explanation.
Error CS1518: Expected class, delegate, enum, interface, or struct…

Brackets on line 12 -24 are fine, you have 3 open and 3 closed ones. I don't get why you have on lines 37 - 43 and 65 - 73. Those string are outside even the namespace scope, put them back in the class scope, under line 14.

This post has been edited by Michael26: 20 December 2013 - 06:00 AM

Was This Post Helpful? 0
  • +
  • -

#12 synlight   User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 582
  • Joined: 14-September 11

Re: I know I'm missing something bigtime C# Beginner

Posted 20 December 2013 - 11:09 AM

You might want to remove your name and university out of your original post.
Was This Post Helpful? 0
  • +
  • -

#13 SplinteredChaos   User is offline

  • D.I.C Head

Reputation: 11
  • View blog
  • Posts: 115
  • Joined: 15-September 11

Re: I know I'm missing something bigtime C# Beginner

Posted 20 December 2013 - 11:57 AM

You should be able to highlight the bracket (either the open or the close) and find the one it is paired with (if there is one), this will allow you to identify what line(s) of code is contained within what brackets. Like Michael pointed out you have lines that are seemingly just floating around in nowheresville.
Was This Post Helpful? 0
  • +
  • -

#14 AdamSpeight2008   User is offline

  • MrCupOfT
  • member icon

Reputation: 2298
  • View blog
  • Posts: 9,535
  • Joined: 29-May 08

Re: I know I'm missing something bigtime C# Beginner

Posted 20 December 2013 - 12:02 PM

I think they'll be OK, we're not writing the code for the just give them a hint regarding the grammar. The C# syntax and grammar can be a little tricky at times. Not like we're providing the algorithm or program is it?

Additionally there is an extension that colourises the braces differently depending on the nesting level, which makes it much easier to see where the belong.

This post has been edited by AdamSpeight2008: 20 December 2013 - 12:02 PM

Was This Post Helpful? 0
  • +
  • -

#15 Curtis Rutland   User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5106
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: I know I'm missing something bigtime C# Beginner

Posted 20 December 2013 - 12:38 PM

I did snip the personal info out, no reason to have it out there.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2