unity and c# basics coursera week 3 quiz answers

C# basics quiz

1. True or false: C# is similar to Java and JavaScript.

  • True
  • False

2. What are the benefits of using coding conventions? Select all that apply.

  • Coding conventions facilitate copying, changing and maintaining the code.
  • Coding conventions enable readers to understand the code more quickly.
  • Coding conventions create a consistent look to the code.
  • Coding conventions take away the manual input of codes and notations.

3. Which naming convention would you use to name a class, record or struct? Select the best answer.

  • Camel case
  • Pascal case

4. Which naming convention would you use for private or internal fields? Select the best answer.

  • Camel case
  • Pascal case

5. Which types of naming conventions have you used? How did you find them useful?

Pascal case, Camel case, snake_case, and kebab-case. These naming conventions help improve code readability, maintainability, and consistency.

C# programming concepts quiz

6. How can scripts be attached to objects? Select all that apply.

  • Select Component from the top navigation, and then select Scripts.
  • Drag and drop.
  • Select GameObject from the top navigation.
  • Select the Add Component button.

7. Which statement or function would you use in a script to make a decision based on a condition? Select the best answer.

  • IF statement
  • SetActive function
  • LookAt
  • WhileLoop

8. Which function is used to remove GameObjects?

Destroy

Shuffle Q/A 1

9. Which function can detect a click on a Collider or a GUI text element? Select the best answer.

OnMouseDown

10. True or false: The scope of a variable is the area in code in which the variable can be used.

  • True
  • False

Leave a Reply