Kerala Plus One Computer Science Previous Year Question Paper 2018
Time Allowed: 2 hours
Cool off time: 15 Minutes
Maximum Marks: 60
General Instructions to Candidates :
- There is a ‘cool off time’ of 15 minutes in addition to the writing time of 2
- Use the ‘cool off time’ to get familiar with the questions and to plan your answers.
- Read questions carefully before you answering.
- Read the instructions carefully.
- Calculations, figures, and graphs should be shown in the answer sheet itself.
- Malayalam version of the questions is also provided.
- Give equations wherever necessary.
- Electronic devices except non-programmable calculators are not allowed in the Examination Hall.
Answer all questions from 1 to 5
Question 1.
What is the base of Mayan Number System?
Question 2.
Name any two preprocessor directives in C++
Question 3.
Which statement in C++ can transfer control of a program to a labeled statement?
Question 4.
Which character is used to delimit the string in memory?
Question 5.
An electronic device used for communication between computers through the telephone line is ……….
Answer any nine questions from 6 to 16
Question 6.
Draw the block diagram of John Von Neumann’s computer architecture.
Question 7.
List any four image file formats.
Question 8.
What is cache memory?
Question 9.
Draw a flowchart to find the area of a rectangle.
Question 10.
What are the different types of characters in the character set of C++? C++
Question 11.
Classify data types used in C++.
Question 12.
How many bytes are required to store the following arrays?
Question 13.
Distinguish the memory allocation of the following initialization statements.
char name[10] = “TOM”;
char str[] = “TOM”;
Question 14.
Current the program and write the output
#include<iostream> using namespace std; int main () { Char str[ ]= “Green Computing”; int n; n=strlen (str); cout< <n; return o; }
Question 15.
What is a firewall?
Question 16.
What is phishing?
Answer any nine questions from 17 to 27.
Question 17.
a. A number of symbols used in a number system are called
b. Find MSD in the decimal number 7854-25
c. Find octal equivalent of (400)10.
Question 18.
a. ASCII stands for………….
b. Find the largest number in the list,
1. (1oooo)2
2. (1ooo)8
3. (1oo)10
4. (1o)l6
Question 19.
a. Name two different language processors which translate the high-level language program into machine language program.
b. What is the operating system? Give two examples?
Question 20.
What is the operating system ? Give two examples.
Question 21.
a. Distinguish between entry controlled loop and exit controlled loop
Step l: Start
Step 2: N = l
Step 3: Print N
Step 4: N = N + 1
Step 5: If N<=10 Then Go To step 3
Step 8: Stop
b. When we implement the above algorithm in C++, what will be the output?
Question 22.
What is the role of relational operators in C++ ? Give suitable examples.
Question 23.
Distinguish between the break and continue statements in C+ +.
Question 24.
If 24, 54, 89, 56, 76, 42, 5 are the elements of an array, illustrate the working of selection sort algorithm for sorting these elements in descending order.
Question 25.
Write a C++ program to input the scores of 5 students and display them in reverse order using an array.
Question 26.
Explain the difference between Call-byvalue and Call-by-reference methods with suitable examples.
Call-by-value, Call-by-reference
Answer any nine questions from 28 to 30
Question 27.
Explain the scope of variables in a C++ program.
Question 28.
List and explain various components of system software.
Question 29.
What will be the output of the given C++ program? Justify your answer.
#include<iostream> using namespace std; int main( ) { int a, b, num; for (a=i; a< = io; ++a) { for (b=i; b<=5; ++b) num = a*b; cout<<num<<endl; } return 0; }
b. Rewrite the following program using while and do-while loops. (Write separate programs)
#include<iostream> using namespace std; int main( ) { int i; for (i=i; i<=io; i++) { cout< <i; } return o; }
Question 30.
a. URL stands for……
b. Explain the format of URL with an example.
c. What is the use of URL in computer networks?
Answer
Answer 1.
20
Answer 2.
#define, #undef
Answer 3.
goto statement
Answer 4.
‘\o’
Answer 5.
MODEM
Answer 6.
Von Neumann architecture consists of a central processing unit (CPU) containing arithmetic logic unit (ALU) and controls unit (CU), input-output unit and a memory for storing data and instructions. This model implements the ‘Stored Program Concept’ in which the data and the instructions are stored in the memory.
Answer 7.
JPEG (Joint Picture Experts Group), bitmap file format (BMP), Tagged Image File Format (TIFF), Graphics Interchange Format (GIF).
Answer 8.
It is a small and fast memory between the processor and RAM. Frequently accessed data, instructions, intermediate results, etc. are stored in cache memory for quick access.
Answer 9.
Let l, b, A are the variables.
Answer 10.
1. Letters: A – Z, a – z
2. Digits: 0 – 9
3. Special characters: +, -, *, \, ∧, /, ( ), [ ], { }, =, <, >, ?, !, @, %, #, $
4. White spaces: Blank space (space bar), tab, return, new line, form feed
5. Other characters: 256 ASCII characters
Answer 11.
Based on nature, size and associated operations, data types are classified into fundamental data types, user-defined data types and derived data types. Predefined data types (fundamental data types) in C++ are char, int, float, double and void.
Answer 12.
2 x 2 x 5 = 20 bytes
2 x 25 = 50 bytes
Answer 13.
char name[io] = “TOM”;
Here is the first statement, 10 memory locations will be allocated and the string will be stored with null character as the delimiter. The last six bytes . will be left unused,
char str[ ] = “TOM”;
Here the size of the array is not specified and hence only 4 bytes will be allocated
(3 bytes for the string and 1 for ‘\o’)-
Answer 14.
#include <iostream> #include <cstdio> using namespace std; int main( ) { char str[ ]= “Green Computing”; int n; n=strlen(str); cout<<n; return 0; } The output will be 15.
Answer 15.
Firewall is a system that controls the incoming and outgoing network traffic by analyzing the data and then provides security to the computer network in an organization from other networks (internet).
Answer 16.
It is an attempt to get others information such as usernames, passwords, bank a/c details etc by acting as the authorized website. Phishing websites have URLs and home pages similar to their original ones and mislead others, it is called spoofing.
Answer 17.
a. base or radix
b. 7
c. (620)8
Answer 18.
a. American Standard Code for Information Interchange
b. i. (10000)2 =1 x 24 + 0 x 23 + 0 x 22+0 x 21 + 0 x 20 = 16 + o + 0 + o = 16
ii. (1000)8 = 1 x 83 + o x 82 + ox 81 + o x 8° = 512 + 0 + o + o = 512
iii.(100)10
iv. (10)16 = 1 x 161 + o x 16°= 16
Here (1ooo)8 is the largest number.
Answer 19.
a. Compiler, interpreter
b. It is a set of programs that act as an interface between the user and computer hardware, eg., Linux, MS Windows.
Answer 20.
Entry controlled loop:
1. Initialization before loop definition.
2. No guarantee to execute the loop body at least once.
3. e.g.for loop, while loop
Exit controlled loop:
1. Initialization before loop definition.
2. Will execute the loop body at least once even though the condition is False.
3. eg., do while loop
Answer 21.
a.
b. This C++ program will display the first 10 natural numbers. 123456789 10
Answer 22.
Used for comparing numeric data. These are binary operators. The result of any relational operation will be either True or False. They are < (less than), > (greater than), <= (less than or equal to), >= (greater than or equal to), == (equal to), != (not equal to).= is an assignment operator used to assign a value to the variable. == is a relational operator that tests for equality.
Answer 23.
break:
- Used with switch and loops.
- Brings the program control outside the switch or loop by skipping the rest of the statements within the block.
- Program control goes out of the loop even though the test expression is True.
continue:
- Used only with loops.
- Brings the program control to the beginning of the loop by skipping the rest of the statements within the block.
- Program control goes out of the loop only when the test expression becomes False.
Answer 24.
Answer 25.
#include <iostream> using namespace std; int main( ) { int i, score[5]; for(i=o; i<5; i++) { cout<<“Enter the scores: "; cin>>score[i]; } for(i=4; i>=o; i- -) cout<<“Scores of student” <<i <<“ is” << score[i]<<endl; return o; }
Answer 26.
Call by value method:
1. Ordinary variables are used as formal parameters.
2. Actual parameters may be constants, variables or expressions.
3. The changes made in the formal arguments are not reflected in actual arguments.
4. Exclusive memory allocation is required for the formal arguments
Call by reference method:
1. Reference variables are used as formal parameters.
2. Actual parameters will be variables only.
3. The changes made in the formal arguments are reflected in actual arguments.
4. Memory of actual arguments is shared by formal arguments. Call-by-value:
eg., eg., void change(int n) { n = n + 1; cout << “n =” << n << ‘\n’; } int main() { int x = 20; change(x); cout << “x = ” << x; }
Here only the value of the variable x is passed to the function. Thus the formal parameter n in the function will get the value 20. When we increase the value of n, it will not affect the value of the variable x. The output of the above code
is n = 21, x = 20
Call-by-reference: void change(int & n) { n = n + 1; cout << “n = ” << n << ‘\n’; } int main() { int x=20; change(x); cout << “x = ” << x; } Here the output will be n = 21, x = 21
Answer 27.
The scope of local variables:
1. Declared within a function or a block of statements.
2. Available only within that function or block.
3. Memory is allocated when the function or block is active and freed when the execution of the function or block is completed.
The scope of global variables:
1. Declared outside all the functions.
2. Available to all the functions of the program.
3. Memory is allocated just before the execution of the program and freed when the program stops execution.
eg., #include <iostream> using namespace std; int cubefint n) { int cb; cout<< “The value of x passed to n is” << x; /*This is an error because the variable x is declared within the main() function. So it cannot be used in other functions. */ cb = n * n * n; return cb; } int main() { int x, result; cout << “Enter a number : ”; cin >> x; result = cube(x); cout << “Cube = ” << result; cout << “\nCube = ”<<cb; }
In the above program, the scope of the variable CB is in the cube( ) function because it is declared within that function. Hence this variable cannot be used outside the function. This scope is known as local scope.
Answer 28.
System software is a set of one or more programs designed to control the operations of a computer.
The following are components of system software:
1. Operating system: It is a set of programs that acts as an interface between the user and computer hardware. The primary objective of an operating system is to make computer system convenient to use. The operating system is the most important system software.
2. Language processors: Language processors are software used to convert programs written in assembly language or high-level language into ma- 1 chine language.
Various language processors are:
a. Assembler: It converts languages written in assembly language into the machine language.
b. Interpreter: It converts a high-level language into machine language by-line by line. If there is an error in one line, it reports and the execution is terminated. It will continue the translation only after the correction of the error. eg., BASIC is an interpreted language.
c. Compiler: It translates a high-level language into machine language by converting all the lines at a time. The errors are provided at the end of the compilation. The programming language that have a compiler are C, C++, Pascal, etc.
d. Utility software: A set of programs which help users in system maintenance tasks and in performing tasks of routine nature.
Utility programs are:
a. Compression tools: Large files can be compressed so that they take less storage area. Compression of files is known as zipping and decompression is called unzipping, eg., WinZip, WinRAR.
b. Disk defragmenter: It is a program that rearranges files on a computer hard disk. This enables the computer to work faster and more efficiently.
c. Backup software: It duplicating the disk information so that in an event of disk failure or in an event of accidental deletion, this backup may be used. Backup utility programs facilitate the backing up of the disk.
Answer 29.
a.
5
10
15
20
25
30
35
40
45
50
Only the outer loop statement will execute. The inner loop executes only once because of the absence of
{ }. The result variable num and the value of num in the last iteration of the inner loop are displayed using the court statement.
b.
While:- i = 1; while (i< = io) { cout<<i; i++; } Do while:- i = 1; do { cout<<i; i++; } while (i<=io);
Answer 30.
a. Uniform Resource Locator
b. Provides a way to locate a resource on the web, the hypertext system that operates over the internet.
c. URL has three parts.
1. http: It means a hypertext transfer protocol. It is a protocol used to transfer hypertext.
2. www: Means World Wide Web. With an email address, we can open our mailbox from anywhere in the world.
3. The third part is a unique name. It is the official website name of signals Window System, eg., hscap.kerala