Click here to Skip to main content
15,905,322 members
Please Sign up or sign in to vote.
1.18/5 (7 votes)
See more:
Hello,

I wrote my program and I got this error. " } expected".

Here is my code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Project_6
{
    public partial class Form1 : Form
    {
        const decimal basePay = 250m, quota = 1000m, rate = .15m;
        decimal sales, commissionValue, pay;
        public Form1()
        {
            InitializeComponent();
        }

        private void nameTextBox_TextChanged(object sender, EventArgs e)
        {

        }

        private void salesAmountTextBox_TextChanged(object sender, EventArgs e)
        {

        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close();
        }
        private void commission()
            {
            if (sales >= quota)
            {
                commissionValue = sales * rate;
            }
            else
            {
                commissionValue = 0m;

    }
}

        private void payToolStripMenuItem_Click(object sender, EventArgs e)
        {
            sales = decimal.Parse(salesAmountTextBox.Text);
            commission();
               
            if (commissionValue > 0)
                {
                    commissionTextBox.Text = commissionValue.ToString("N2");
                }
                else
                {
                    commissionTextBox.Text = "";
                }
                pay = basePay + commissionValue;
                totalPayTextBox.Text = pay.ToString("N2");
                salesAmountTextBox.Text = sales.ToString ("N2");
            }

        }


I am very new to c# please help! I am using visual studio 2010.
Posted
Updated 18-Nov-17 7:19am
v2

You have add 1 more } at the end

namespace Project_6
{
 
Share this answer
 
v2
Comments
i am mexican 10-May-11 22:18pm    
Thank You !! =)
You need to add one more "}" at the end.
 
Share this answer
 
Comments
i am mexican 10-May-11 22:18pm    
Thank you as well !!
HimanshuJoshi 10-May-11 22:35pm    
Welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900