FINAL Flashcards
(50 cards)
Which keyword is used to define a class in C#?
a) class
b) ClassName
c) void
d) public
a) class
What characters can a class name include?
a) Letters and spaces
b) Letters, digits, and underscores
c) Only letters
d) Letters, digits, underscores, and special symbols
b) Letters, digits, and underscores
A variable declaration in C# must include:
a) Only the variable type
b) Only the variable name
c) Variable name and type
d) Variable name, type, and initial value
c) Variable name and type
What is the recommended naming convention for variables?
a) PascalCase
b) UPPERCASE
c) snake_case
d) lowerCamelCase
d) lowerCamelCase
What type of method can be called without creating an object of the class?
a) Public
b) Static
c) Abstract
d) Void
b) Static
What is a Form in a Windows application?
a) A textual interface
b) A graphical element like a window or dialog
c) A type of database
d) A programming function
b) A graphical element like a window or dialog
Which namespace contains the Control class?
a) System.Windows.Forms
b) System.Drawing
c) System.Control
d) System.IO
a) System.Windows.Forms
What is the purpose of an event handler?
a) To create graphical interfaces
b) To handle events triggered by user interactions
c) To generate SQL queries
d) To manage database connections
b) To handle events triggered by user interactions
What are the two parameters of an event handler in C#?
a) sender and EventArgs
b) source and EventHandler
c) Button and Label
d) Component and Control
a) sender and EventArgs
How can you add a button to a Form in Visual Studio?
a) By writing the code manually
b) By dragging it from the Toolbox
c) By importing it from a library
d) By creating a new namespace
b) By dragging it from the Toolbox
Which category of design patterns deals with object creation?
a) Behavioral patterns
b) Structural patterns
c) Creational patterns
d) Procedural patterns
c) Creational patterns
What does the Adapter pattern do?
a) Converts one interface to another
b) Manages object creation
c) Defines a template for methods
d) Updates relational databases
a) Converts one interface to another
The Bridge pattern helps to:
a) Link two separate applications
b) Decouple abstraction from implementation
c) Create database connections
d) Synchronize data between tables
b) Decouple abstraction from implementation
Which pattern notifies dependent objects of state changes?
a) Factory Method
b) Observer
c) Adapter
d) Singleton
b) Observer
The Factory Method pattern:
a) Creates an object without specifying the exact class
b) Updates existing objects
c) Directly accesses private attributes
d) Bridges two incompatible classes
a) Creates an object without specifying the exact class
What is an update anomaly?
a) When data is duplicated in a table
b) Inconsistent data after a partial update
c) Loss of data due to a deletion
d) Inability to add new data
b) Inconsistent data after a partial update
In which normal form must a table have no multi-valued columns?
a) 1NF
b) 2NF
c) 3NF
d) BCNF
a) 1NF
What is a transitive dependency?
a) When one column depends on another non-key column
b) When a column depends on the primary key
c) When a table has no foreign keys
d) When a table is in 1NF
a) When one column depends on another non-key column
What is the purpose of normalization?
a) To reduce data redundancy and improve integrity
b) To increase the size of databases
c) To create graphical interfaces
d) To manage database connections
a) To reduce data redundancy and improve integrity
Which type of anomaly occurs when you cannot add data to a table due to missing related data?
a) Update anomaly
b) Insert anomaly
c) Delete anomaly
d) Referential anomaly
b) Insert anomaly
Which SQL command is used to retrieve data?
a) SELECT
b) INSERT
c) UPDATE
d) DELETE
a) SELECT
What does the following SQL command do?
INSERT INTO Customers (Name, Country) VALUES (‘John’, ‘USA’);
a) Deletes a record from the Customers table
b) Updates a record in the Customers table
c) Adds a new record to the Customers table
d) Retrieves data from the Customers table
c) Adds a new record to the Customers table
Which SQL command modifies existing records?
a) SELECT
b) INSERT
c) UPDATE
d) DELETE
c) UPDATE
How do you remove a record in SQL?
a) SELECT * FROM table
b) DELETE FROM table
c) DROP table
d) REMOVE FROM table
b) DELETE FROM table