# Plus One Computer Science Previous Year Question Paper 2017

## Kerala Plus One Computer Science Previous Year Question Paper 2017

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.
• 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 l to 5

Question 1.
The number (158)10 can be represented in Hexadecimal number system as……..

Question 2.
a. Write the following memory devices in the order of their speed, (fastest to g slowest order)
1. Cache
2. RAM
3. Hard disk
4. Registers
b. What do you mean by freeware and shareware?

Question 3.
Pick the odd one out and give a reason for your finding.

Question 4.
(a) Name the type of loop which can be used to ensure that the body of the loop will surely be executed at least once.

(b) Consider the code given below and predict the output.

for (int i = 1; i < = 9; i = i + 2)
{
if (i = = 5) continue;
cout >> i << " ";
}

Question 5.
Find the value of score [4] based on the following declaration statement.

score [5] = {98, 87, 92, 79, 85};

Question 6.
Name the built-in function to check whe­ther a character is alphanumeric or not.

Question 7.
a. Different networks with different proto­cols are connected by a device called
1. Router
2. Bridge
3. Switch
4. Gateway
b. Define Protocol.

Question 8.
Find the best matches from the given definitions for the terms in the given list. (Worm, Hacking, Phishing, Spam)
a. Unsolicited e-mails sent indiscrimi­nately.
b. A technical effort to manipulate the normal behavior of the networked computer system.
c. A stand-alone malware program usually makes the data traffic slow.
d. Attempt to acquire information like usernames and passwords by posing as the original website.
e. Appear to be useful software but will do damage like deleting necessary funds.

Question 9.
Represent -3 8 in 2’s complement form.

Question 10.
Write an algorithm to print the numbers up to 100 in reverse order. That is the output should be as 100, 99, 98, 97,….,
OR
Draw a flowchart to check whether the given number is positive, negative or zero.

Question 11.
Identify the invalid literals from the following and write a reason for each.
a. 2E3.5
b. “9”
c. ‘hello’
d. 55450

Question 12.
The following C++code segment is a part of a program written by Smitha to find the average of 3 numbers.

int a, b, c;
float avg;
cin>>a>>b>>c;
avg = (a+b+c)/3;
cout<<avg;

What will be the output if she inputs 1,4 and 5? How can you correct it?

Question 13.
Let M[3][3] be a 2D array that contains the elements of a square matrix. Write C++  statements to find the sum of the diagonal elements.

Question 14.
What are the advantages of using gets() function in C++ program to input string data? Explain with an example.

Question 15.
Read the function definition given below, Predict the output, if the function is called as convert

void convert (int n)
{
if (n>l) convert (n/2); cout<<n%2;
}

Question 16.
Compare any three features of five gene­rations of computers

Question 17.
Draw the logic circuit of Boolean expre­ssion:
$$(A+\bar { BC)+ } \bar { AB\quad }$$
OR
Using algebraic method, prove that
$$\bar { Y } .\bar { Z } +\bar { Y } .Z+Y.Z+Y=1$$

Question 18.
“It is better to give proper documentation within the program”. Give a reason.

Question 19.
Briefly explain the three components in the structure of a C++ program.

Question 20.
Write an algorithm for arranging elements of an array in ascending order using bubble sort.

Question 21.
Explain the difference between call-by-value method and call-by-reference method with the help of examples.

Question 22.
Compare any three types of networks based on span of geographical area.

Question 23.
Susheel’s e-mail ID is susheel@gmail.com. He sends an e-mail to Rani whose e-mail ID is rani@yahoo.com. How is the mail sent from Susheel’s computer to Rani’s computer?

Question 24.
With the help of a block diagram, explain the functional units of a computer.

Question 25.
Write a program to check whether the given number is palindrome or not. (5)
OR
Write a program to print the leap years between 2000 and 3000.
(A century year is a leap year only if it is divided by 400 and a non-century year is a leap year only if it is divided by 4.)

9E

a. Registers, Cache, RAM, Hard disk
b. Freeware refers to copyrighted com­puter software which is made avail­able for use free of charge for a un­limited period.
Shareware refers to commercial software that is distributed on a trial basis. It is distributed without payment and with limited functionality.

(c) ; Others has only one entry flow and one exit flow.
(b) ; Used for both input and output operations.

a. do while loop
b. l 3 7 9

85

isalpha( )

a. (iv). Gateway
b. Protocols are rules and conventions for transmitting data.

a. Spam
b. Hacking
c.Worm
d. phishing

Let i be the variable.
Step 1: Start
Step 2: Let i = 100
Step 3: Print i
Step 4: i = i – 1
Step 5: If i>=1, then goto Step 3
Stop 6: Stop
OR

Invalid literally are:
(a).2E3.5; the fractional number cannot be used as an exponent.
(c). ‘hello’; String literals are enclosed within a pair of double quotes.

The output will be 3.
(a+b + c)/3.o
or float (a+b+c)/3
or int a, b, c are replaced by float a, b, c or use of typecasting

#include <iostream>
using namespace std;
int main( )
{
int m[3][3], n, i, j, s=o;
cout<<“Enter the rows/columns of square matrix:
cin> >n;
cout<<“Enter the elements\n”;
for(i=o; i<n; i++)
for(j=o; j<n; j++)
cin>>m[i][j];
cout<<“Diagonal elements are\n”; for(i=o; i<n; i++)
{
cout<<m[i][i]<<“\t”; s = s + m[i][i];
}
cout<<“\nSum of Diagonal elements is:
cout<<s; return o;
}

By using gets( ) function we can input string with white space.
cin statement reads till a white space. But the function gets() is used to accept a string of characters including white spaces from the standard input device (keyboard) and store it in a character array.
eg., char str[3o];
gets(str);
puts(str);

The output will be 111.
This is a recursive function. The pro­cess of calling a function by itself is known as recursion and the function is known as a recursive function.

First-generation computers (1940-56):
The first generation computers were built using vacuum tubes. This genera­tion implemented the stored program concept, eg., Electronic Numerical Integra­tor and Calculator (ENIAC), Electronic Dis­crete Variable Automatic Computer (EDVAC), Universal Automatic Computer (UNIVAC).

Second-generation computers (1956-63):
In this generation computers, vacuum tubes were replaced by transistors. This allowed computers to become smaller and more powerful and faster. The manufac­turing cost was also less. The concept of programming language was developed. Programming languages FORTRAN and COBOL were introduced, eg., IBM 1401, IBM 1620.

Third generation computers (1964­71):
These are smaller in size due to the use of integrated circuits (IC’s). IC dras­tically reduced the size and increased the speed and efficiency of computing. Keyboards and monitors were intro­duced. The high-level language BASIC was developed during this period, eg., IBM 360, IBM 370.

Fourth-generation computers (1971 onwards):
The computers that we use today belong to this generation. These computers use microprocessors and are called microcomputers use Large Scale of Integration (LSI). These computers are smaller in size and have faster ac­cessing and processing speeds, eg., IBM PC, Apple II.

Fifth-generation computers (future):
These are based on artificial intelli­gence. The fifth-generation computing also aims at developing computing machines that respond to natural lan­guage input and are capable of learn­ing and self-organization.

Documentation is an on-going process that starts in the problem study phase of the system and continues till its implementation and operation. We can write comments in the source code as part of the documentation. It provides suffi­cient information in a program to un­derstand its working. If the program is documented, it helps to understand the logic we applied. It helps the debugging process as well as program modification at a later stage.

1. Preprocessor directives:
A C++ pro­gram starts with preprocessor direc­tives. Preprocessors are the compiler directive statements which give instruction to the compiler to process the information provided before ac­tual compilation starts. The #include is used to link the header files available in the C++ library. There are some other pre-processor direc­tives such as #define, #undef, etc.

It contains the informa­tion about functions, objects, and pre­defined derived data types and they are available along with compiler. The header file stream contains the information about the objects cin and court.

3. The main( ) function:
The execution starts at main ( ) and ends within main ( ). If we use any other function in the program, it is called (or in­voked) from the main Q. The function header main ( ) is followed by its body, which is a set of one or more statements within a pair of braces { }. This structure is known as the definition of the main f) function. Each statement is delimited by a semicolon (;).

Step 1: Start
Step 2: Accept a value in N as the num­ber of elements of the array.
Step 3: Accept N elements into the array AR.
Step 4: Repeat Steps 5 to 7, (N -1) times.
Step 5: Repeat Step 6 until the second last element of the list.
Step 6: Starting from the first position, compare two adjacent eleme­nts in the list. If they are not in proper order, swap the elements.
Step 7: Revise the list by excluding the last element in the current list.
Step 8: Print the sorted array AR.
Step 9: Stop

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 ar­guments are not reflected in actual arguments.
4. Exclusive memory allocation is required for formal arguments.

eg., void change find n)
{
n = n + 1;
cout << “n =” << n << ‘\n’;
}
int main( )
{
int x = 20;
change( );
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 method:

1. Reference variables are used as formal parameters.
2. Actual parameters will be variables only.
3. The changes made in the formal ar­guments are reflected in actual ar­guments.
4. The memory of actual arguments is shared by formal arguments.
eg., void changefint & n)
{
n = n + 1;
cout << “n = ” << n << ‘\n’;
}
int mainf)
{
int x=20;
change(x);
cout << “x = ” << x;
}
Here the output will be n = 21, x = 21

The network is classified based upon the amount of geographical area that covers.
1. Personal Area Network (PAN): It is used to connect devices situated .in a small radius by using guided media or unguided media.

2. Local Area Network (LAN): This is used to connect computers in a single room or buildings of one location by using twisted pair wire or coaxial cable,  Data transfer rate is high and the error rate is less.

3. Metropolitan Area Network (MAN): It is a network spread over a city,  MAN have lesser speed than LAN and the error rate is less. Here optical fi- J ber cable is used, eg., Cable TV net­work.

4. Wide Area Network (WAN): This is used to connect computers over a large geographical area. It is a net­work of networks. Here the comput­ers are connected using telephone lines or Microwave station or satel­lites. The error rate in data transmis­sion is high, eg., internet.

When an e-mail is sent from your com­puter, it first reaches the e-mail server of our e-mail service provider. From there the e-mail is routed to the recipi­ents e-mail server through the internet. The recipient’s e-mail server delivers the e-mail to recipients inbox which stores the message. SMTP (Simple Mail Transfer Protocol) is used e-mail com­munication.

Functional units of a computer are based on a model proposed by John Von Neu­mann. It consists of some functional units namely Input Unit, Central Pro­cessing Unit (CPU), Storage Unit and Output Unit.

1. Input unit. The collected data and the instructions for their processing are entered into the computer through the input unit. They are stored in the memory (storage unit). The data may be in different forms. Keyboard, mouse, scanner, mic, digital cam­era, etc. are some commonly used in­put devices.

2. Central Processing Unit (CPU). The CPU is the brain of the computer. In a computer system, all major computations and comparisons are made inside the CPU. It is also responsible for activating and controlling the operations of other units of the com­puter. The functions of CPU are per­formed by three components; Arith­metic Logic Unit (ALU), Control Unit (CU), Registers.

3. Storage unit. The data and instruc­tions entered in the computer through input unit are stored inside the computer before actual process­ing starts. The information or results produced after processing are also stored inside the computer, before transferring to the output unit. The intermediate results, if any, must also be stored for further processing.

4. Output unit. The information ob­tained after data processing is sup­plied to the outside world through the output unit in a human-readable form. Monitor and printer are the commonly used output devices.

#include <iostream>
using namespace std;
int main()
{
int num, c, digit, rev=o;
cout<<“Enter the number:";
cin> >num; c=num;
while(num != o)
{
digit = num % 10;                                 '
rev = (rev * 10)+ digit;
num = num/10;
}
cout<<“The reverse of the number is”
<<rev;
if (rev == c)
cout<<“\nThe given number is a palindrome.";
indrome.”; else
cout<<“\nThe given number is not a
palindrome.”;
return o;
}
OR
#include <iostream>
using namespace std;
void main()
{
int i;
for (i=2000; i<=3000; i++) {
if (i%4 == o)
{
if (i%400 == o) cout << i;
}
return 0;
}