XII First Term Exam 2024
XII First Term Exam 2024
SECTION-A
6. Which one of the following DOS commands is used to display content of the directory?
a) DIR b) CD c) MD d) VIEW
7. Identify the type of system conversion in which the old system is directly replaced by the
new system:
8. Which one of the following statements transfers the control to the start of loop body?
Page 1 of 5
a) switch b) continue c) break d) exit()
9. if x=5, which one of the following accesses the 7th element stored in an array A?
Page 2 of 5
SECTION-B
Q#2: Attempt all parts. (3*14= 42)
i. Differentiate between functional and non-functional requirements.
OR Differentiate between unary and binary operators with one example each.
ii. What is planning phase in SDLC and what are the structures involved?.
OR what is process management. Explain with one example.
iii. What will be displayed after executing the following statements?
int x = 4, y = 17; cout << --y << “\t” << y / x++ << “\t” << x % y<<”\n”<<y;
OR Write down the output of the following statements:
a. A = (x <=5) && (y >=15) where x = 5, y = 15
b. S = 20 - 16 % 4
c. m += 2; where m = 2
iv. Write down the purpose and syntax of break statement
OR Write down the purpose and syntax of exit() function.
v. Why is it important to write Comments in a program? Also differentiate its two types.
OR What is the difference between constant and variable? Give examples also.
vi. Write down the output of the following program segment:
char c = ‘A’;
do { cout << c << ”\t”; c = c + 3; }
while (c <= ‘K’ ); OR
Write down the output of the following program segment: int values [ ] = {4, 17, 20, 9, 23};
cout << values [0] << "\n"; cout << values [3] <<"\n"; cout << values [1]<<"\n";
vii. Rewrite the following statement using if-else statement:
cout << ( ( (num % 2) = = 0) ? "Even \ n" : "Odd \ n");
OR
Convert the following while loop to a for loop such that the output remains same.
int i = 20;
while (i > 0)
{
cout << i << “\t”; i = i - 2;
}
viii. What is the difference between array size and index? Illustrate with example
Page 3 of 5
OR
Rewrite the program segment after removing errors:
int a{10}, i; cout >> ” enter ten numbers ;
for (i = 0; i < 10; i--)
cin << a{i};
ix. Write down the purpose of sizeof() function with example.
OR
Consider the array definition: float table[5][5];
a. How many elements does an array have?
b. Write statement that assigns 36.5 to the first element of array.
x. What is OS and Describe its core functionalities.
OR
Write the stakeholders of SDLC.
xi. Write are the steps involved in deployment phase of SDLC.
OR
What are the key roles and duties of system analyst in SDLC?
xii. Write nested loop to print the following on the screen:
**********
**********
**********
OR
What is embedded OS?
xiii. Declare an array named arr, that has 3 rows and 5 columns and assign it values from 1 to
15 in the declaration statement.
OR Differentiate between strcmp() and strcpy() with one example each.
xiv. What is the advantage of using cin.get() over cin statement for reading a string? Explain
with an example.
OR
What is the purpose of iostream.h, conio.h, math.h and string.h header files also write few
of their built-in functions.
Page 4 of 5
SECTION-C
Attempt all parts. (5*4= 20)
Q#3: Write a C++ program that displays the following menu:
Geometry Calculator
1. Display Area of a Circle
2. Display Area of a Rectangle Enter your choice (1-3):
If user enters 1, the program should ask for the radius of the circle and then display its
area. Use formula: area = πr2.
If user enters 2, the program should ask for the length and width of the rectangle and
then displays its area, use formula: area = length x width.
Display an error message if the user enters a number outside the range of 1 - 3.
OR
Write a C++ code that prints sum of the following series: 12 + 32 + 52 + 72 + . . . .+ 992
Q#4: What is a process and write its various states along with block diagram.
OR
Write a program that reads a string and copies it into another string and print on the screen.
Q#5: Write a program to input data from keyboard in a two-dimensional array x, that has x
rows and c columns and print the sum of each row in the following format:
Sum of row 1 =
Sum of row 2 =
.
.
Sum of row r =
OR
Write a program that takes 2 strings from user and print both strings with their lengths.
Q#6: Write a program that reads three strings and prints the smallest.
OR
Explain multi-threading and multi programming OS with one example each.
Page 5 of 5