2023 Computer Application Honours theory exam questions along
with answers, based on available sources:
Sample Questions and Answers for 2023 Computer Application
Honours
Question 1
Design a class named Student with member variables: name, age, marks, stream. Include
methods to accept data, allocate stream based on marks, and print the details.
Answer:
A Student class in C++/Java with methods to accept input, allocate stream according to
marks criteria, and display the details.
Question 2
What is the type of operator &&? Explain its usage.
Answer:
&& is a logical operator that evaluates to true if both operands are true; otherwise, false.
Used for compound logical conditions.
Question 3
Write a method prototype for a function named check that takes an integer argument and
returns a character.
Answer:
char check(int x);
Question 4
What is an infinite loop? Give an example.
Answer:
A loop that runs forever without termination. Example:
for (int i = 5; i != 0; i += 2) {
// Loop conditions never met to exit
}
Question 5
Explain polymorphism in object-oriented programming.
Answer:
Polymorphism allows classes to be treated as instances of their parent class, enabling
methods to perform differently based on the object calling it (method overloading and
overriding).
Question 6
Explain how to declare and initialize a one-dimensional array in C. Write a program to
perform linear search on it.
Answer:
int arr[^5] = {1, 2, 3, 4, 5};
// Linear search
int key = 3, found = 0;
for (int i = 0; i < 5; i++) {
if (arr[i] == key) {
printf("Found at position %d\n", i);
found = 1;
break;
}
}
if (!found) printf("Not found\n");