Kerala Plus One Computer Science Model Question Paper 1
Answer all question from 1 to 5
Question 1.
Which data type of C++ does not require any memory space?
Question 2.
Who is regarded as the father of modern Computer Science as well as artificial intelligence?
Question 3.
In C++, ………. loop will execute at least once even though the condition is false.
Question 4.
In C++, ………. function is used to input a character or string using cin.
Question 5.
Expand URL.
Answer any nine questions from 6 to 16
Question 6.
What are the advantages of the second generation of computers over first generation computers?
Question 7.
Find the dual of following boolean equation:
- \(X+\bar { X } =1 \)
- \((X+0).(X.1.\bar { X } )=0\)
Question 8.
Which are the various e-waste disposal methods?
Question 9.
Draw the flowchart to find the simple interest. [Hint : I = P * N * R]
Question 10.
Explain any two escape sequences used in C++.
Question 11.
List and correct the errors in the following C++ statement
Question 12.
What are the different ways to write comments in C++?
Question 13.
Write a brief explanation for the below mentioned C++ statement :
int a[ ]={2,3,5,6,9};
Question 14.
Explain the memory allocation for the string.
Question 15.
Which are the various e-waste disposal methods?
Question 16.
What are the hardware and software requirements for connecting a computer to the internet?
Answer any nine questions from 17 to 27
Question 17.
Fill in the blanks.
(49)10 = (……………… )2 = (………………. )8 =
Question 18.
a. Write an algorithm to print the even numbers between 1 and 1oo.
b. Write anyone advantages of using the flowchart.
Question 19.
Explain different components of CPU.
Question 20.
Which are the different universal gates? Why they are called so? Draw the logical symbols of these gates.
Question 21.
Describe the different phases in programming.
Question 22.
What will be the output of the following C++ program?
#include<iostream> using namespace std; int main() { int a, b, c; a = 5; b = 8; c = a; cout<<“\n Value of a is” <<++a; cout<<“\n Value of b is” <<b++; cout<<“\n Value of c is” <<- -c; return 0; }
Question 23.
Differentiate if……… else if and switch statements in C+ +.
Question 24.
Explain any three array operations.
Question 25.
Write C++ statements to declare a two-dimensional array of integers having 3 rows and 2 columns and input values to it
Question 26.
Explain about any three string functions in the header file cstring.
Question 27.
Differentiate call-by-value and call-by-reference methods in function calls.
Answer any two questions from 28 to 30
Question 28.
a. What is network topology?
b. Which are the different types of network topologies?
Question 29.
Explain about any five input or output devices used in a computer.
Question 30.
Write a C++ program to input an integer and check whether it is Amstrong number or not.
[Hint: Amstrong number is the one in which sum of cubes of digits in that number is the number itself.]
Answer
Answer 1.
void data type
Answer 2.
Alan Turing
Answer 3.
do……. while
Answer 4.
4- get()
Answer 5.
Uniform Resource Locator
Answer 6.
The first generation computers were built using vacuum tubes. This generation implemented the stored program concept.
In second generation computers, vacuum tubes were replaced by transistors. This allowed computers to become smaller and more powerful and faster. They also became less expensive, required less electricity and emitted less heat.
Answer 7.
- \(X+\bar { X } =1 \)
- \((X+0).(X.1.\bar { X } )=0\)
Answer 8.
1. Reuse: It refers to second-hand use or usage after the equipment has been upgraded or modified
2. Incineration: It is a controlled and 10. C++ represents Octal Number and complete combustion process in which the waste is burned in specially designed incinerators at a high temperature in the range of 900 to 1000 degree Celsius.
3. Recycling: It is the process of making or manufacturing new products from a product that has originally served its purpose.
4. Landfilling: In this method, the soil is excavated from the trenches made and waste material is buried in it, which is covered by a thick layer of soil.
Answer 9.
Answer 10.
C++ represents Octal Number and Hexadecimal Number with the help of escape sequences. The \on and \xHn represent a number in the octal number system and the hexadecimal number system respectively
Answer 11.
The letter ‘C’ in cout should be in the small letter. Every C++ statement end with a semicolon!;). After cout the << operator should be used. The correct statement is,
cout<<“Computer Science”;
Answer 12.
Comments are lines in the code that are added to describe the program. They are ignored by the compiler.
- Single line comment: The characters // (two slashes) is used. The text appearing after // in a line is treated as a comment by the C++ compiler.
- Multiline comments: Anything written within /* and */ is treated as comment so that the comment can take any number of lines.
Answer 13.
It is an integer array with name ‘a’. It is initialised at the time declaration | with values 2, 3, 5, 6, 9.
Answer 14.
The memory required depends upon the number of characters stored. A null character ‘\o’ is stored at the end of the string. This character is used as the string terminator and added at the end automatically. So the memory required to store a string will be equal to the number of characters in the string plus one byte for the null character.
eg., char str[ ] = “Hello”;
Here the size of the array is not specified and hence only 6 bytes will be allocated
(5 bytes for the string and 1 for ‘\o’).
Answer 15.
Scope of local variables:
- Declared within a function or a block of statements.
- Available only within that function or block.
- 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:
- Declared outside all the functions.
- Available to all the functions of the program.
- Memory is allocated just before the execution of the program and freed when the program stops the execution.
Answer 16.
The hardware and software requirement for internet:
- A computer with a modem (internal/external).
- A telephone connection.
- An account with an ISP.
- A browser software.
Answer 17.
Answer 18.
Let i be the variable.
Step 1: Start
Step 2: Let i = 2
Step 3: Print i
Step 4: i = i + 2
Step 5: If i>=1oo, then go to Step 3
Step 6: Stop
b. Better communication: Since a flowchart is a pictorial representation of a program, it is easier for a programmer to explain the logic of the program to some other programmer through a flowchart rather than the program itself.
Answer 19.
The CPU consists of three components; Control unit (CU), Arithmetic logic unit (ALU) and registers. All the major calculations and comparisons are made inside ALU. CU is responsible for activating and controlling the operations of the units of the computer. Registers are storage locations inside CPU, whose content can be accessed more quickly by the CPU than other memory. They are temporary storage areas for instructions or data.
Answer 20.
The NAND and NOR gates are called universal gates. A universal gate is a gate which can implement any Boolean function without using any other gate type.
NAND gate: This is an AND gate with its output inverted by a NOT gate.
NOR gate: This is an OR gate with its output inverted by a NOT gate.
Answer 21.
1. Problem identification: During this phase, you will be able to identify the data involved in processing, its type and quality, the formula to be used, activities involved and the output to be obtained. This is the challenging phase as it exploits the efficiency of the programmer.
2. Preparing algorithms and flowcharts: Once the problem is identified, it is necessary to develop a precise step-bystep procedure to solve the problem. This procedure is not new or confined to computers.
3. Coding the program: The process of writing program instructions to solve a problem is called coding. The program written in any HLL is known as source code.
4. Translation: It is the process of converting a program written in a high-level language into its equivalent version in machine language. The compiler or interpreter is used for this purpose.
5. Debugging: It is the stage where the project known as ‘bugs’ and the process of detecting and correcting these errors is called debugging.
Answer 22.
a = 5
b = 9
c = 4
Answer 23.
Switch:
- Permits multiple branching.
- Evaluates conditions with equality operator only.
- Case constant must be an integer or I a character type value.
- When no match is found, the default statement is executed.
- the break statement is required to exit from the switch statement.
- More efficient when the same variable or expression is compared against a set of values for equality.
else if ladder:
- Permits multiple branching.
- Evaluates any relational or logical expression.
- The condition may include a range of values and floating point constants.
- When no expression evaluates to True, else block is executed.
- Program control automatically goes out after the completion of a block.
- More flexible and versatile compared to switch.
Answer 24.
1. Traversal: Accessing each element of the array at least once is called traversal. We can use this operation to check the correctness of operations during operations like insertion, deletion etc. Displaying all the elements of an array is an example of traversal,
eg., for (i=o; i,<1o; i++) cout<< a[i]<< “\t”;
2. Sorting: It is the process of arranging the elements of the array in some logical order. This logical order may be ascending or descending in case of numeric values or dictionary order in case of strings.
3. Searching: It is the process of finding the location of the given element in the array. The search is said to be success. full if the given element is found, that is the element exists in the array; otherwise unsuccessful. There are basically two approaches to a search operation. They are linear search and binary search.
#include <iostream> using namespace std; int main( ) { int mat[3][2], i, j; cout<<“Enter the elements\n”; for(i=o; i<3; i++) for(j=o; j<2; j++) cin>>mat[i][j]; return o; }
Answer 26.
1. strlen (): This function is used to find the length of a string, i.e., the number of characters in the string. Its syntax is:
int strlen (string);
eg., n = strlen (“Hello”);
Here returns the number of characters in the string, i.e. 5 to the variable n.
2. strcpy( ): This function is used to copy one string into another. The syntax is: strcpy
(string 1, string 2);
The function will copy string 2 to string 1.
eg., strcpy(s1,s2);
3. strcat( ): This function is used to append one string to another string. The length of the resultant string is the total length of the two strings. The syntax is strcat (string 1, string 2);
The size of the first argument should be able to accommodate both the strings together.
eg., strcat(s1,s2);
Answer 27.
Call by value method:
- Ordinary variables are used as formal parameters.
- Actual parameters may be constants, variables or expressions.
- The changes made in the formal arguments are not reflected in actual arguments.
- Exclusive memory allocation is required for the formal arguments.
Call by reference method:
- Reference variables are used as formal parameters.
- Actual parameters will be variables only.
- The changes made in the formal arguments are reflected in actual arguments.
- The memory of actual arguments is shared by formal arguments.
Answer 28.
1. a. The physical or logical arrangement of computers on a network is called structure or topology. It is the geometrical arrangement of computers in a network.
b. Star, ring, mesh, bus, tree, and hybrid are the different network topologies.
c. Star topology: It has a server all other computers are connected to it. Advantages add or remove workstations to a star network is easy and the failure of a workstation will not effect the other. The disadvantages are that if the server fails the entire network will fail.
2. Bus topology: All the computers are attached to a single cable called the bus. Here one computer transmits all other computers listen. Therefore it is called the broadcast bus. The transmission from any station will travel in both the direction. The connected computers can hear the message and check whether it is for them or not. Advantages are added or remove computer is very easy. It requires less cable length and the installation cost is less. The disadvantage is fault detection is very difficult because of no central computer.
Answer 29.
Input devices are:
1. A light pen is a pointing device shaped like a pen. The tip of the light pen contains a light-sensitive element which when placed against the screen enabling the computer to identify the location of the pen on the screen. The advantage is drawing directly on to the screen.
2. The touch screen allows the user to operate by simply touching on the display screen. It can also be operated using a stylus which gives more precision,
3. The joystick is used for playing video games, controlling training simulators and robots. The joystick has a vertical stick which can move in any direction. It has a button on the top that is used to select the option pointed by the cursor.
4. Keyboard: It is the most common input device. It allows the user to input alphabets, numbers and other characters, Keyboard detects the key pressed and generates the corresponding ASCII code which can be recognised by the computer. It has a keyboard layout called the QWERTY design.
5. Mouse: It is a small hand-held device used to indicate the position of a cursor or its movement on a computer display screen by rolling it over a mouse pad/ flat surface. A mouse has one or more buttons and possibly a scroll wheel. The scroll wheel is used for scrolling the screen vertically or horizontally.
Output devices are:
1. Visual Display Unit (VDU): It visually conveys text, graphics, and video information. The information shown on a display device is called soft copy because and is displayed for a temporary period of time.
2. Printers: These are used to produce hardcopy output. Based on the technology used, they can be classified as impact printers and non-impact printers.
3. Plotter: It is an output device used to produce hard copies of graphs and designs on the paper.
4. 3D printer: It is a new generation output device used to print 3D objects. The 3D printing process turns the object to be printed into thousands of horizontal tiny little layer. These tiny layers stick together to form a solid object.
5. Speaker: It produces sound. The speaker produces sound by the movement of the diaphragm in the speaker forward and backward according to the electrical signals coming out of the audio port.
Answer 30.
include<iostream> using namespace std; int main() { int n, i = 1, r, cb = o; cout<<“Enter a number: cin>>n; i =n; while (n) { r = n%io; cb = cb + r * r * r; n = n/10; } if (cb==i) cout<<“The given number is an Armstrong number } return o; }