C# Lesson 1- Quiz

5 Questions | Attempts: 48
Share

SettingsSettingsSettings
Lesson Quizzes & Trivia

This is the Lesson 1 Quiz. Each question is worth 5 points. Your final score will reflect the percentage of total points that you earned. Please consider re-assessing this lessons if you score less than 70%.


Questions and Answers
  • 1. 

    The C# source code that is compiled into a program is written in “clear text”. Which of the following programs cannot create C# source code?

    • A.

      'Office' software like Microsoft's Word or The Document Foundation's LibreOffice

    • B.

      Plain text editors like Scite or Notepad

    • C.

      Terminal emulators like Microsoft's CMD.exe or a Linux shell

    Correct Answer
    C. Terminal emulators like Microsoft's CMD.exe or a Linux shell
    Explanation
    C# programs consist of standard text that can be created by most text editors, as long as the editor saves that text in a 'plain' or 'clear text' format.

    Rate this question:

  • 2. 

    The first part of a C# program to execute is named:

    • A.

      Class

    • B.

      BEGIN

    • C.

      Main

    • D.

      HELLO WORLD

    Correct Answer
    C. Main
    Explanation
    The first part of a C# program to be run by the computer is the function named “main”.

    Rate this question:

  • 3. 

    The 'namespaces' in a C# program are mostly used to:

    • A.

      Show which programmers programmed different code

    • B.

      Change the order that the program is run in

    • C.

      Prevent different variable names from being confused by the programmer

    • D.

      Prevent different variable names from being confused by the compiler

    Correct Answer
    D. Prevent different variable names from being confused by the compiler
    Explanation
    Every object and type of object in C# belongs to a namespace. As long as two such things are in different namespace, they can have the same name, but not otherwise

    Rate this question:

  • 4. 

    The C# langauge teats which of the following as comments?

    • A.

      Lines that begin with '#'

    • B.

      Lines that begin with //

    • C.

      Any text surrounded by '{' and '}'

    • D.

      Any text that is capitalized

    Correct Answer
    B. Lines that begin with //
    Explanation
    C# recognizes several styles of comments. Beginning a line with '//' is one way to prevent that lines from being executed, or from interfering with code.

    Rate this question:

  • 5. 

    In C#, the programmer passes values into a function by:

    • A.

      Writing the name of the data to the left of a function name: variable function

    • B.

      Writing the name of the data to the right of the a function name: function() variable

    • C.

      Writing the name of the data in the parentheses immediately after the function name: function(variable)

    • D.

      By writing the value of the variable in the parentheses immediately following the function name: function(1)

    Correct Answer
    C. Writing the name of the data in the parentheses immediately after the function name: function(variable)
    Explanation
    In C#, parentheses are 'function operators'. They tell C# that a name is the name of a function, and they provide a space where data can be listed to be sent to a function.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2022
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 16, 2012
    Quiz Created by
    Shishira
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.