Member Avatar for Member #956681

I keep taking the test over and over I get 2 out of 10 correct.

I think something is wrong with the test can you list me the answers so I could take it if it's wrong then i can contact the admin and tell him his test is not fucntioning correctly.

I took snapshots of the test

1
http://i1157.photobucket.com/albums/p600/napninjanx/5%20Photos/1.jpg

2
http://i1157.photobucket.com/albums/p600/napninjanx/5%20Photos/2.jpg

3
http://i1157.photobucket.com/albums/p600/napninjanx/5%20Photos/3.jpg

4

5

Dani AI

Generated

Brief expert note: posted snapshots of a 10-question Visual C# quiz and asked for help. gave quick answers and corrected one item; asked for an explanation of the first two items. Below are concise, practical explanations of the core C# concepts that typically trip people up on short quizzes — operator precedence, safe parsing, keyword case, ListBox behavior, and loop forms — with small examples to try locally.

Operator precedence — multiplication/division are evaluated before addition/subtraction, and operators of equal precedence evaluate left-to-right. Use parentheses to force the order you want. Try these two expressions in a small console app or the Immediate window to see the difference:

Console.WriteLine(2 + 2 * 2);    // evaluates multiplication first
Console.WriteLine((2 + 2) * 2);  // parentheses change the order

This is the rule behind many small MCQ arithmetic/precedence questions. (learn.microsoft.com)

Parsing strings to integers — calling a parse method that throws on invalid input is common, but safer code first checks the string. Use the TryParse pattern to avoid exceptions and handle malformed input:

string s = "42";
if (int.TryParse(s, out int n)) {
    // use n
} else {
    // invalid input: handle or report error
}

If you must use the throwing parse variant, be ready to catch FormatException/OverflowException. (learn.microsoft.com)

Case and control/UI notes — C# keywords are reserved and case-sensitive, so if (lowercase) is the keyword the compiler expects; IF will not be treated as the same token. For WinForms ListBox behavior, adding an item normally appends it; if Sorted is true the control reorders items automatically — use the Insert or AddRange APIs if you need a specific position or batch add. For intentional infinite loops, for(;;) is a compact form; always include a clear exit path (break/return) when appropriate. (learn.microsoft.com)

Quick debugging tip: reproduce a single question in a tiny console project or LINQPad and print the value — it’s the fastest way to verify what the quiz expects.

Recommended Answers

All 5 Replies

I'm going to answer these but you should have posted what you thought the answer was

  1. 52
  2. 10
  3. int.Parse("42")
  4. IF should be lowercase
  5. true
  6. OR
  7. The answer is 5, but that isn't a choice
  8. 5
  9. listBox1.Items.Add("ME") (the first choice)
  10. do {} while (true);

7 should be 10

7 should be 10

You are correct, I misread the i as a 1.

can u explain the first 2 answers....?

Order of precidence says you do multiply/divide before add/subtract.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.