Font size
WorksheetsOOP- Quiz #1
Total questions: 55
Worksheet time: 34mins
It is programming about writing procedures or methods that perform operations on the data.
(a)
It is programming about creating objects that contain both data and methods.
(a)
Object-oriented programming has several advantages over procedural programming and one is not faster and easier to execute. TRUE/ FALSE
TRUE
FALSE
Object-oriented programming has several advantages over procedural programming. It helps to keep the Java code DRY "Don't Repeat Yourself", and makes the code easier to maintain, modify and debug. TRUE/ FALSE
TRUE
FALSE
Object-oriented programming has several advantages over procedural programming. It provides a clear structure for the programs. TRUE/ FALSE
TRUE
FALSE
Object-oriented programming has several advantages over procedural programming. OOP Makes it possible to create full reusable applications with less code and shorter development time. TRUE/ FALSE
TRUE
FALSE
A principle is about reducing the repetition of code.
(a)
is a blueprint or a template for creating objects.
(a)
These are variables that hold data related to a class and its objects.
(a)
These are functions defined inside a class that describe the behaviors or actions that an object can perform.
(a)
It is an instance of a class. When a class is defined, no memory is allocated.
(a)
are fundamental to organizing and structuring code in a way that is reusable, scalable, and easier to maintain.
(a)
are the two main aspects of object-oriented programming.
(a)
When the individual objects are created, they inherit all the variables and methods from the class. TRUE/ FALSE
TRUE
FALSE
Remember from the java syntax that a class should always start with a lowercase first letter, and that the name of the java file should match the class name.. TRUE/ FALSE
TRUE
FALSE
an object-oriented programming language.
(a)
To create a class, use the keyword (a) .
To create an object of (a) , specify the class name, followed by the object name, and use the keyword new:
To create an object of Main, specify the class name, followed by the object name, and use the keyword (a) :
You can also create an object of a class and access it in another class. This is often used for better organization of classes (one class has all the attributes and methods, while the other class holds the main() method (code to be executed)).
Using Multiple Classes
Using Single Class
Classes
Objects
Use myObj to access and print the value of the x attribute of MyClass.
(a)
Call myMethod on the object.
(a)
Another term for class attributes is (a) .
You can access attributes by creating an object of the class, and by using the (a) syntax
is a branch of artificial intelligence (AI) that focuses on building systems that can learn from data, identify patterns, and make decisions with minimal human intervention
(a)
_________ are used to store up temporary data to be used in our program's runtime.
Datatype
Identifiers
Variables
Data
The type of data inside our variable.
Data
Variables
Identifiers
Data Type
_________ are used to store up temporary data to be used in our program's runtime.
Datatype
Identifiers
Variables
Data
The type of data inside our variable.
Data
Variables
Identifiers
Data Type
It is the name of the variables that the programmer indicated and it is used to read and write to the variable.
Identifiers
Datatype
Variables
Concatenation
The process of joining strings together with the plus operator.
Identifiers
Concatenation
Datatypes
Variables
Syntax in declaring variables
identifier datatype;
identifier datatype = value;
datatype identifier
value = identifier datatype;
datatype identifier
value identifier = datatype;
datatype identifier;
datatype identifier = value;
Syntax in reassigning variables
identifier = value
identifier = value;
value = identifier
value = identifier;
Which of the ff. is an example of Concatenation
"Hello" + "World"
2 + 3
'a' + 3
Hello + World
You can concatenate ________ a variable
Beside
Inside
Outside
All of the above
We can display a variable's value by indicating its identifier inside the parenthesis.
System.outprintIn();
System.out.printIn;
System.out.printIn()
System.out.printIn();
You can use numbers but with letters.
Rule of Identifier
Rule of Concatenation
Rule of Declaring Variables
Rule of Reassigning Datatypes
What is the purpose of a RadioButton control?
To allow multiple selections at once
To display a single option from a group of choices
To display text only
To display images only
What is the purpose of a RadioButton control?
To allow multiple selections at once
To display a single option from a group of choices
To display text only
To display images only
When a user clicks on a RadioButton, what happens to other radio buttons in the same group?
They become disabled
They become checked
They become unchecked
They become invisible
Which property of a RadioButton determines its current state?
Checked
Selected
Enabled
Visible
How does a RadioButton differ from a CheckBox?
RadioButton allows multiple selections; CheckBox allows single selection
RadioButton allows single selection; CheckBox allows multiple selections
RadioButton has no visual difference from CheckBox
RadioButton is used for displaying images only; CheckBox is used for displaying text
Which event is triggered when a RadioButton's state changes?
Click
CheckedChanged
SelectedIndexChanged
CheckedStateChange
Can a RadioButton display both text and images simultaneously?
Yes
No
How can you programmatically check a RadioButton using C#? 6
radioButton.IsChecked = true;
radioButton.Selected = true;
radioButton.Checked = true;
radioButton.Enabled = true;
Which control allows the user to select multiple options at once
RadioButton
CheckBox
ListBox
ComboBox
Which method is used to add items to a ListBox dynamically
AddItem()
InsertItem()
Add()
Insert()
How can you retrieve the currently selected item in a ListBox as a string variable? 9
listBox.SelectedText
listBox.SelectedItem
listBox.Text
listBox.SelectedValue
Which method is used to remove an item from a ListBox based on its index?
Remove()
Delete()
RemoveAt()
DeleteAt()
: What property of a ListBox determines whether items are sorted alphabetically?
Sorted
IsSorted
SortEnabled
IsSortedAlphabetically
What is the purpose of a ComboBox control in C# Windows Forms applications?
To display a text box combined with a ListBox
To allow multiple selections from a list of items
To provide a drop-down list of options for user selection
To display images only
What is the purpose of grouping RadioButton controls?
To limit the number of selections
To visually organize them on the form
To make them behave as a single entity
To apply a common style to them
What is the name of the Speaker last Tuesday May 21, 2024 (Cyber Security)
(a)
The Object Oriented paradigms suggest we should model instructions in a computer program with the data they manipulate and store these as components together.
TRUE
FALSE
A 'Class' is a software design w/c describes the general properties of something w/c the software is modelling.
TRUE
FALSE
