ADVANCED OBJECT-ORIENTED PROGRAMMING TEST FOCUS

5.0(2)
studied byStudied by 13 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/47

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

48 Terms

1
New cards

arr.GetLength(0);

Suppose you have a two-dimensional array named arr. How are you going to get the length of its rows?

2
New cards

structure

It is a fundamental concept in the C# programming language that allow you to define and manipulate composite data types.

3
New cards

Base Case

This refers to the "stopping case" and the simplest way of the problem that can be directly solved

4
New cards

Escape Sequences

These are used for characters that cannot be printed using the normal way of printing

5
New cards

c. these are methods used to MODIFY the values of private data members of a class from outside the class

What is the purpose of setters?
a. these are methods used to ACCESS the values of private data members of a class from outside the class
b. these are special methods, but does not return a value
c. these are methods used to MODIFY the values of private data members of a class from outside the class
d. all of these

6
New cards

internal

Members with this access modifier are visible to the subclass and any class within the same assembly

7
New cards

d. Use the abstract keyword before the class keyword.

How do we define abstract classes in C#?
a. Use the abstract keyword after the class keyword.
b. Use the abstract-class keyword after the class keyword.
c. Use the abstract-class keyword before the class keyword.
d. Use the abstract keyword before the class keyword.

8
New cards

Microsoft

Who developed C#?

9
New cards

a. represent the state or characteristics of an object
d. defined within the class and store the object's data

Which of the following defines a field?
a. represent the state or characteristics of an object
b. define the behavior of the objects
c. allow you to perform actions or calculations related to the state of the object
d. defined within the class and store the object's data

10
New cards

c. Can be instantiated independently without the need for subclasses.
d. Can be directly instantiated using the new keyword.
e. Contains concrete implementations for all its methods.

Which of the following describes a concrete class?
a. Exists to serve as a blueprint for other classes.
b. Subclasses must implement all abstract methods.
c. Can be instantiated independently without the need for subclasses.
d. Can be directly instantiated using the new keyword.
e. Contains concrete implementations for all its methods.
f. May contain both abstract and concrete methods.

11
New cards

c. to inherit from a base class

What is the purpose of the : keyword?
a. create an instance of the derived class
b. create an object
c. to inherit from a base class
d. to encapsulate data members

12
New cards

do-while

This iterative structure ensures that the statement will be executed once.

13
New cards

Method Overriding

This occurs when a subclass provides a specific implementation for a method that is already defined in its superclass

14
New cards

break

This statement is used to prematurely terminate the loop

15
New cards

void

Which keyword is used if the function does not require to return a value?

16
New cards

{2:C}

Write the format specifier for the third argument, in currency format.

17
New cards

Polymorphism

This OOP principle allows objects of different classes to be treated as objects of a common base class or interface during runtime.

18
New cards

Functions

They are used to encapsulate the set of tasks in a single unit, ensuring the DRY principle.

19
New cards

ref

This keyword is used in passing by reference

20
New cards

index

they refer to the array's addresses/location, and are used to access its elements.

21
New cards

return

this keyword is used to exit a method, providing a value to the caller

22
New cards

{ and }

the function definition is placed inside these characters

23
New cards

member variables

These are places inside the curly braces when defining a structure

24
New cards

arr.GetLength(0);

Suppose you have a two-dimensional array named arr. How are you going to get the length of its rows?

25
New cards

main method

This contains the main logic of the program

26
New cards

structures

these are complex data types that contains multiple data members with various types.

27
New cards

sample:
Rectangle rectangle1 = new Rectangle {Width = 10, Height = 5};

Suppose you created a structure named Rectangle, with integer data members such as Width and Height. How are you going to create an instance of it, initializing 10 and 5 for the value of width and height, respectively?

28
New cards

ref

This keyword is used in passing by reference

29
New cards

Console.Writeline()

This keyword is used in displaying a string literal, or any value in the console

30
New cards

Recursive Functions

These are functions that repeatedly call themselves, and changing the input values

31
New cards

Escape Sequences

These are used for characters that cannot be printed using the normal way of printing

32
New cards

Function Call

This is done by specifying its name and passing the arguments if required

33
New cards

while loop

This iterative structure evaluates the condition before each iteration of the loop

34
New cards

Pass by Reference

This allows methods to modify the original values of the actual parameters directly

35
New cards

dot(.) operator

This operator is used to access the members of a structure

36
New cards

{2:C}

Write the format specifier for the third argument, in currency format

37
New cards

Base Case

This refers to the "stopping case" and the simplest way of the problem that can be directly solved

38
New cards

void

This keyword is used if the method does not have a return type

39
New cards

arr[3,2] = 25;

How will you assign the value 25 to an array named arr, on the fourth row index and third column index?

40
New cards

MidtermPassedCutie

Identify the output of the given codes in each item. Please remember, they are case-sensitive

<p><span>Identify the output of the given codes in each item. Please remember, they are case-sensitive</span></p>
41
New cards

2.000

Identify the output of the given codes in each item. Please remember, they are case-sensitive

<p><span>Identify the output of the given codes in each item. Please remember, they are case-sensitive</span></p>
42
New cards

Jerome is a 4th year student.

Identify the output of the given codes in each item. Please remember, they are case-sensitive

<p><span>Identify the output of the given codes in each item. Please remember, they are case-sensitive</span></p>
43
New cards

Artist

Which of the following is the base class? Write only the class name.

<p><span>Which of the following is the base class? Write only </span><strong><em><span>the class name</span></em></strong><span>.</span></p>
44
New cards

Painter

Which of the following is the derived class? Write only the class name

<p><span>Which of the following is the derived class? Write only </span><strong><em>the class name</em></strong></p>
45
New cards

Fatima

Identify the output of the given codes in each item. Please remember, they are case-sensitive

<p><span>Identify the output of the given codes in each item. Please remember, they are case-sensitive</span></p>
46
New cards

7 14 210 28 35

Identify the output of the given codes in each item. Please remember, they are case-sensitive

<p><span>Identify the output of the given codes in each item. Please remember, they are case-sensitive</span></p>
47
New cards

Minimum value: 8

Identify the output of the given codes in each item. Please remember, they are case-sensitive

<p><span>Identify the output of the given codes in each item. Please remember, they are case-sensitive</span></p>
48
New cards

16


What will be the value of min if i is 2?

<p><br>What will be the value of <strong>min</strong>&nbsp;if <strong>i </strong>is 2?</p>