Variables and Data Types in C# - Kurdistan Technical Institute
31 Questions
1 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the purpose of variables in programming?

  • To display output on the screen
  • To create loops in the program
  • To perform mathematical operations
  • To store multiple values in a single container (correct)
  • Which type of variable stores text values in Java?

  • float
  • char (correct)
  • int
  • bool
  • What is the correct way to create a variable in Java?

  • var variableName = value;
  • create variableName = value;
  • variableName = value;
  • type variableName = value; (correct)
  • If you want to store a number with decimals in Java, which type of variable would you use?

    <p>float</p> Signup and view all the answers

    What happens when you assign a new value to an existing variable?

    <p>The new value overwrites the previous value</p> Signup and view all the answers

    Which type of variable stores values with only two states: true or false?

    <p>bool</p> Signup and view all the answers

    Which of the following is NOT a rule for naming variables in C#?

    <p>Variables can start with a digit</p> Signup and view all the answers

    What keyword is used in C# to declare unchangeable and read-only variables?

    <p>readonly</p> Signup and view all the answers

    Which method is often used to display variable values to the console window in C#?

    <p>WriteLine()</p> Signup and view all the answers

    In C#, when using the + character with numeric values, it functions as a:

    <p>concatenation operator</p> Signup and view all the answers

    Which keyword was introduced in C# to declare method-level variables without explicitly specifying a data type?

    <p>var</p> Signup and view all the answers

    An identifier in C# is used to identify a class, variable, function, or namespace and must start with:

    <p>a letter</p> Signup and view all the answers

    Which of the following is NOT a legal identifier in C#?

    <p>-abc</p> Signup and view all the answers

    When declaring more than one variable of the same type in C#, what can be used to separate the variables?

    <p>, (comma)</p> Signup and view all the answers

    In C#, what happens if a variable is not assigned a value before using it?

    <p>It will give a compile-time error</p> Signup and view all the answers

    Which of the following cannot be used as an identifier name in C#?

    <p><code>this_is_a_very_detailed_name_for_an</code></p> Signup and view all the answers

    What do Information and Communications Technology cover?

    <p>Any product that store, retrieve, manipulate, transmit or receive information electronically in a digital form</p> Signup and view all the answers

    When did the Digital Age (Information Age) begin?

    <p>During the 21st century</p> Signup and view all the answers

    What does the term 'Digital Revolution' refer to?

    <p>The advancement of technology from analog electronic and mechanical devices to digital technology</p> Signup and view all the answers

    What is the main characteristic of the Information Age?

    <p>Rapid shift from traditional industry to an economy based on information technology</p> Signup and view all the answers

    Which devices are considered parts of Information and Communications Technology (ICT)?

    <p>Computers, cellphones, televisions, radios, and satellite systems</p> Signup and view all the answers

    What is the historic period characterized by the rapid shift to an economy based on information technology?

    <p>Information Age</p> Signup and view all the answers

    What is the main purpose of a computer?

    <p>To process input data into useful output information</p> Signup and view all the answers

    Which term is used for unprocessed characters or instructions in a computer?

    <p>Data</p> Signup and view all the answers

    What component of a computer is responsible for analyzing the input data from users at high speed?

    <p>System Unit</p> Signup and view all the answers

    Which type of device is a microphone in the context of a computer system?

    <p>Input Device</p> Signup and view all the answers

    What is the primary function of an output device in a computer?

    <p>To present processed data to users</p> Signup and view all the answers

    Which of the following is NOT considered one of the main components of a computer?

    <p>Scanner</p> Signup and view all the answers

    'Monitor' and 'Printer' are examples of which type of component in a computer system?

    <p>Output Device</p> Signup and view all the answers

    'RAM' is an example of a component belonging to which category in a computer system?

    <p>Storage Device</p> Signup and view all the answers

    'Barcode reader' is an example of which type of device?

    <p>Input Device</p> Signup and view all the answers

    More Like This

    Use Quizgecko on...
    Browser
    Browser