Click here to Skip to main content
15,889,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ok, so I'm a bit rusty at coding and have no experience debugging what so ever. and would really like some help fixing the errors in the title. which are } expected(CS 1513) and ; expected(CS 1002) I'll post the code below.(this is taken from a video lecture done by my professor.) if it is a long process please break it down step by step. line 37 is where all three errors occur they all hinge upon the third parentheses in that line
thank you in advance

C#
int[] freqiMM;
        Random randMM;
        int die1MM = 0;
        int die2MM = 0;
        int rollsMM = 36000;
        int sumMM = 0;
        public Form1()
        {
            InitializeComponent();
            randMM = new Random(DateTime.Now.Millisecond);

            freqiMM = new int[11];
            freqiMM[0] = 0;
            for (int i = 0; i < 11; i++)
                freqiMM[i] = 0;

            for (int i = 0; i < rollsMM; i++)
            {
                die1MM = randMM.Next(1, 7);
                die2MM = randMM.Next(1, 7);
                sumMM = die1MM + die2MM;
                //this.ResultsListBoxMM.Items.Add(sum.ToString());
                freqiMM[sumMM - 2]++;

            }

            double percentMM = 0.0;

            for (int i = 0; i < 11; i++)
            {
                percentMM = (double)freqiMM[i] / (double)rollsMM;
                percentMM *= 100.0;
                ResultsListBoxMM.Items.Add(i + 2).ToString() + "" + percentMM.ToString());
           }

}
}
}


What I have tried:

I have looked through youtube and tried other sites I've even tried contacting my professor to no avail I'm still incredibly lost.
Posted
Updated 22-Sep-18 10:26am
v4
Comments
Patrice T 22-Sep-18 15:17pm    
Show exact error messages and position in this code.

1 solution

Since there are only 37 lines in that code, it doesn't help anyone to say "it's line 49" ...

But ... look at your code. I'm guessing it's this line:
ResultsListBoxMM.Items.Add(i + 2).ToString() + "" + percentMM.ToString());
Where brackets don't match up. What is that final ')' doing immediately before the ';'?
 
Share this answer
 

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