Variables and Data Types in C# - Kurdistan Technical Institute

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 (C)</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 (B)</p> Signup and view all the answers

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

<p>bool (B)</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 (C)</p> Signup and view all the answers

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

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

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

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

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

<p>concatenation operator (A)</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 (D)</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 (D)</p> Signup and view all the answers

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

<p>-abc (B)</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) (A)</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 (A)</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> (D)</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 (D)</p> Signup and view all the answers

When did the Digital Age (Information Age) begin?

<p>During the 21st century (C)</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 (A)</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 (A)</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 (A)</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 (B)</p> Signup and view all the answers

What is the main purpose of a computer?

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

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

<p>Data (B)</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 (C)</p> Signup and view all the answers

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

<p>Input Device (C)</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 (C)</p> Signup and view all the answers

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

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

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

<p>Output Device (D)</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 (B)</p> Signup and view all the answers

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

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

Flashcards are hidden until you start studying

More Like This

Use Quizgecko on...
Browser
Browser