0% found this document useful (0 votes)
9 views13 pages

11CS EM PublicQns 2 2 2 2

The document contains a series of questions and programming tasks related to computer science topics, including generations of computers, operating systems, C++ programming concepts, and error handling. It covers various programming constructs such as loops, functions, classes, and object-oriented programming principles. Additionally, it includes debugging tasks and theoretical questions aimed at assessing knowledge in computer science and programming skills.

Uploaded by

34rishigesh37
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views13 pages

11CS EM PublicQns 2 2 2 2

The document contains a series of questions and programming tasks related to computer science topics, including generations of computers, operating systems, C++ programming concepts, and error handling. It covers various programming constructs such as loops, functions, classes, and object-oriented programming principles. Additionally, it includes debugging tasks and theoretical questions aimed at assessing knowledge in computer science and programming skills.

Uploaded by

34rishigesh37
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

11 – Computer Science

March – 2020
11. (a) Discuss the various generations of computers.
OR
(b) Write the uses of operating system.
12. (a) Explain the types of errors in C++.
OR
(b) What is an entry controlled loop? Explain any one of the entry controlled loop with syntax and
suitable example.
13. (a) What are the key differences between if - else and switch statements in C++?
OR
(b) Explain scope rules of variables in C++ with example.
14. (a) (i) What is structure? What is its use?
(ii) Write the syntax and an example for creating a structure.
(iii) How to access members of a structure? Give example.
OR
(b) Write the output for the following C++ program.
Assume the values for age as 23, height as 161.5 and weight as 45.
#include <iostream>
using namespace std;
struct Student
{
int age;
float height, weight;
}obj;
int main()
{
cout<<”\nEnter the age:”;
cin>>obj.age;
cout<<"\nEnter the height:";
cin>>obj.height;
cout<<"\nEnter the weight:”;
cin>>cbj.wright;
cout<<”\nYour details:";
cout<<"\nAge:”<<obj.age;
cout<<"\tWeight:"<<obj.weight;
return 0;
}
15. (a) (i) Explain the main features of OOPS.
(ii) What are the advantages of OOPS.
OR
(b) Debug the given C++ program to get the following output:
Output
Sum Constructor:
Difference Constructor:
1. Add:
2. Difference:
Enter your choice :2
Enter the values for a and b :20 60

..24.. A. Prabhakar - 9442979144


11 – Computer Science
The difference of two numbers are: -40
Difference Destructor:
Sum Destructor:
Program
?include<iostream>
using namespace std
class sum
{
int a, s;
protected:
int b;
publicly:
void sum()
{
a = b = s = 0;
cout<<”\nSum Constructor:”;
}
void input();
{
cout<<"\nEnter the values for a and b :";
cin>>a>>b;
}
void addition()
{
s = a+b;
cout<<"\nThe sum of two numbers is:”<<s;
}
void minus()
{
return a-b;
}
+sum()
{
cout<<"\nSum Destructor:";
}};
class difference # public sum
{
int d1;
public:
difference()
{
d=0;
cout<<"\nDifference Constructor:”;
}
vid sub()
{
input();
d=minuses();

..25.. A. Prabhakar - 9442979144


11 – Computer Science
cout<<"\nThe difference of two numbers are:"<<d;
}
~difference()
{
cout<<"\nDifference Destructor:";
}
};
int main[]
{
difference obj;
int ch=0;
cout<<"\n1. Add:\n\nDifference:";
cout<<"\n\nEnter your choice:";
cin>>ch;
switch(ch);
{
case “1”:
obj.input();
obj.addition();
break;
case 2:
obj.sub();
break;
}
return 0;
};
SEPTEMBER - 2020
16. (a) (i) Convert (98.46)10 to binary
(ii) Find the 2's complement of (-46)10
(iii) Add (1101010)2 + (101101)2
(iv) Subtract (1101011)2 - (111010)2
(v) Convert (145)8 to binary
OR
(b) Explain the parts of a window in Windows Operating System.
17. (a) (i) What are tokens in C++?
(ii) Explain the types of tokens in C++ with suitable example.
OR
(b) Write a C++ program to find the sum of the series given below.
S=1+x+x²+....+ xn
18. (a) Explain the for loop in C++ with its syntax and a suitable example.
OR
(b) Explain call by value method with suitable example.
19. (a) (i) Write a note on the main features of object oriented programming.
(ii) Explain the advantages and disadvantages of Object Oriented Programming.
OR
(b) Write the output for the following C++ program.
#include<iostream>
using namespace std;
..26.. A. Prabhakar - 9442979144
11 – Computer Science
class Trial
{
int x;
public:
void assign(int y)
{
x=y;
}
void test(Trial obj1, Trial obj2)
{
obj1.x=10;
obj2.x=20;
cout<<"\nValue of Object1 :"<<obj1.x;
cout<<"\nValue of Object2 :"<<obj2.x;
}
void display() adasala
int main()
{
Trial a1,a2,a3;
a2.assign(45);
a1.assign(54);
cout<<"\nValue of first assignment :";
a2.display();
cout<<"\nValue of second assignment:";
a1.display();
cout<<"\nValue of first assignment after passing the values :";
a3.test(a1,a2);
cout<<"\nValue of second assignment after passing the values :";
a2.display();
a1.display();
return 0;
}
20. (a) Explain the different visibility mode in C++ with a suitable example.
OR
(b) Debug the given C++ program to get the following output:
Output
The width of the box is :20 The length of the box is :67
Program
#include <stream>
using namespace std:
classes Box
{
double width;
public::
double length;
int printWidth()
{
cout<<"\nThe width of the box is:"<<<<width;

..27.. A. Prabhakar - 9442979144


11 – Computer Science
cout<<"\nThe length of the box is :"<<length;
}
void setWidth(double w,l);
}
void Box?:setWidth(double w,double I)
{
width=w;
length=l;
}
int MAIN()
{
Box obj;
b.setWidth(67.0,20.0);
b.print Width();
exit 0;
}
SEPTEMBER - 2021
21. (a) What are the rules for operator overloading?
OR
(b) (i) Convert (923)10 into Octal and Hexadecimal.
(ii) Convert (99.76)10 into Binary.
22. (a) Explain the types of Microprocessors.
OR
(b) What are the types of Errors?
23. (a) What are arithmetic operators in C++? Differentiate unary and binary arithmetic operators. Give
example for each of them.
OR
(b) What is a 'switch' statement and mention the rules for switch statement.
24. (a) Answer the following:
(i) Define functions.
(ii) What is default argument? Give example.
OR
(b) Debug the given C++ program to get the following Output :
Output
Blue
Red
Orange
Yellow
Program
$include <stdio.h>
using namespace;
int main[ ]
{
float colour [4] [10]={"Blue", "Red", "Orange",}
for(int i=0; i<4; i++);
cout<<colour[j]<<"\t";
}
}
..28.. A. Prabhakar - 9442979144
11 – Computer Science
25. (a) Discuss the various generations of computers.
OR
(b) Write the output for the following.
#include <iostream>
using namespace std;
class student //base class
{
private:
char name[20];
int rno;
public:
void acceptname()
{
cout<<"\n Enter roll no and name.."; cin>>rno>>name;
}
void displayname()
{
cout<<"\n Roll no :-"<<rno;
cout<<"\n Name :-"<<name<<endl;
}
};
class exam: public student //derived class with single base class
{
public:
int mark1, mark2, mark3;
void acceptmark()
{
cout<<"\n Enter 3 subject marks..";
cin>>mark1>>mark2>>mark3;
}
void displaymark()
{
cout<<"\n\t\t Marks Obtained";
cout<<"\n Subject1..." <<mark1;
cout<<"\n Subject2..." <<mark2;
cout<<"\n Subject3..."<<mark3;
}
};
class result: public exam
{
int total;
public:
void showresult()
{
total=mark1+mark2+mark3;
cout<<"\nTOTAL MARK SCORED : "<<total;
}
};

..29.. A. Prabhakar - 9442979144


11 – Computer Science
int main()
{
result r1;
r1.acceptname(); //calling base class function using derived class object
rl.acceptmark(); //calling base class function which itself is a derived
//class function using its derived class object
r1.displayname(); //calling base class function using derived class object
r1.displaymark(); /*calling base class function which itself is a derived
class function using its derived class object*/
r1.showresult(); //calling the child class function
return 0;
}
MAY - 2022
26. (a) Explain Data and Information.
OR
(b) Explain the types of ROM.
27. (a) Explain the versions of windows operating system.
OR
(b) Write the specification of an algorithm for computing the square root of a number.
28. (a) Explain the types of errors.
OR
(b) Explain multi-way branch statement (switch) with a suitable example.
29. (a) Explain the parts of a Loop.
OR
(b) Find the output of following program.
#include<iostream>
using namespace std;
int main()
{
int num[10], even = 0, odd = 0;
for(int i=0; i<10; i++)
{
cout<<"\n Enter Number"<<i+1<<”=”;
cin>>num[i];
if(num[i]%2==0)
++even;
else ++odd;
}
cout<<"\n There are"<<even<<"Even Numbers";
cout<<"\n There are”<<odd<<"Odd Numbers";
}
30. (a) Debug the following C++ program:
Output:
----------
15
14
13
----------
..30.. A. Prabhakar - 9442979144
11 – Computer Science
Program:
%include(iostream.h)
#include<conio.h>
Class A
{
public;
int a1,a2:a3;
Void getdata[ ]
{
a1 = 15;
a2 = 13; a3 = 13;
}
}
Class B :: public A()
{
PUBLIC
voidfunc()
{
int b1:b2:b3;
A::getdata[ ];
b1 =a1 ;
b2 =a2;
b3=a3;
cout<<b1<<'\t'<<b2<<’t\’<<b3;
}
void main()
{
clrscr()
B der;
der1:func();
getch();
}

OR
(b) Explain the advantages of object oriented programming.
July - 2022
31. (a) Explain the various generation of computers.
OR
(b) Explain 1's compliment representation with an example.
32. (a) Explain the characteristics of a microprocessor.
OR
(b) Explain if...else statement with a suitable example.
33. (a) Explain the different types of inheritance.
OR
(b) Explain case analysis with an example.
34. Explain the use of header file with examples.
OR
(b) What is an entry control loop? Explain any one of the entry controlled loop with suitable
example.
..31.. A. Prabhakar - 9442979144
11 – Computer Science
35. (a) Explain call by value method with suitable example.
OR
(b) What are the rules for operator overloading?
March - 2023
36. (a) Discuss the various Generations of Computers.
OR
(b) Explain the process management algorithms in Operating System.
37. (a) (i) Write the procedure to convert fractional decimal to binary.
(ii) Convert (98.46)10 to Binary.
OR
(b) Arrange the memory devices in ascending order based on the access time.
38. (a) Explain about Binary Operators used in C++.
OR
(b) Explain Call by value method with example.
39. (a) Mention the difference between constructor and destructor
OR
(b) Write the output of the following program:
#include<iostream>
using namespace std;
int main()
{
char dev[5] [10] = {"Monitor", "Speaker", "Printer", "Scanner", "Keyboard"};
for(int i = 0 ; i<5 ; i++)
cout<< dev[i] <<”\n” ;
}
40. (a) Explain the different types of Cyber attacks.
OR
(b) Debug the following C++ program.
Output:
Constructor of base class...
Constructor of derived...
Constructor of derived1...
Destructor of derived1...
Destructor of derived...
Destructor of base class...
Program:
$include<iostream>
using namespace std;
class base()
{
Public
base()
{
cout<<"\n Constructor of base class...";
}
!base()
{
cout<<"\n Destructor of base class...";
};
}

..32.. A. Prabhakar - 9442979144


11 – Computer Science
Class derived :: public base
{
public
derived()
{
cout<<"\n Constructor of derived...";
}

!derived()
{
cout<<"\n Destructor of derived...";
}
};
Class derived1: public derived
{
public:
derived 1();
{
cout<<"\n Constructor of derived1...";
}
derived 1();
{
cout <<"\n Destructor of derived 1...";
}
}
int main():
{
derived1 x;
return 0;
}
June - 2023
41. (a) Explain the basic components of a computer with a neat diagram.
OR
(b) List out the uses of operating system.
42. (a) Explain the characteristics of a Microprocessor.
OR
(b) (i) Add : 11010102 +1011012
(ii) Subtract : 11010112 -1110102
43. (a) Explain control statements with suitable example.
OR
(b) Explain the main features of Object Oriented Programming.
44. (a) Explain the different visibility mode through pictorial representation.
OR
(b) (i) What are the rules for function overloading?
(ii) State the rules for Operator overloading.

45. (a) (i) What is Parameter and list its types.


(ii) Write a short note on pow() function in C++.
..33.. A. Prabhakar - 9442979144
11 – Computer Science
OR
(b) Debug the following C ++ program:
Program:
%include(istream)
using namespace Std
int main []
{
int n, num, digit, rcv = 0
Cout >> "Enter a positive number:";
Cin >>num ;
n = num :
while (num)
{
digit =num%0
rev=(rev*10)+ digit ;
num = num / 10
}
Cout <<" The reverse of the number is : <<rev <<endl;
if (n== rev ) ;
Cout <<" The number is a palindrome;
else:
Cout >> The number is not a palindrome":
return 0;
}
}
Output 1:
Enter a positive number: 1221
The reverse of the number is: 1221
The number is a palindrome.
Output 2:
Enter a positive number: 1234
The reverse of the number is: 4321
The number is not a palindrome.
March – 2024
31. (a) Explain the basic components of a computer with a neat diagram.
OR
(b) Explain the concept of a Distributed Operating System along with its advantages.
32. (a) Perform binary addition for the following.
(i) (-21)10 +(5)10 (ii) (-12)10 +(15)10
OR
(b) What is function overloading? What are the rules for function overloading?
33. (a) Explain about the types of ROM.
OR
(b) Write the differences between if-else and switch statement.
34. (a) What is an output unit? Explain any three output devices.
OR
(b) Write the output of the following program.
#include<iostream>
..34.. A. Prabhakar - 9442979144
11 – Computer Science
using namespace std;
class student
{
int rno, marks;
public:
student(int r,int m)
{
cout<<"Constructor"<<endl;
rno=r;
marks=m;
}
void printdet()
{
Marks=marks+30;
cout<<"Roll no :"<<rno<<"\n";
cout<<"Marks :"<<marks<<endl;
}
};
int main()
{
student s(14,70);
s.printdet();
cout<< "Back to Main";
return 0;
}
35. (a) Explain the different types of inheritance.
OR
(b) Debug the following C++ program.
Output:
Total area: 35
Program:
%include<iostream>
using namespace std:
CLASS Shape
{
Private ()
int count
Protected;
int width;
int height;
PUBLIC;
Void setwidth [int w]
{
width=w;
};
void setheight (int h)
{
height=h;

..35.. A. Prabhakar - 9442979144


11 – Computer Science
}
}
Class rectangle:: Public Shape
{
Public
int getarea []
{
return (width* height);
};
}
int MAIN()
{
rectangle rect :
rect. setwidth(5);
rect.setheight(7);
cout>>"Total area : "
<<rect.getarea()<<endl;
return 0;
};
JULY - 2024
36. Discuss the various generations of Computers.
OR
(b) (i) Add: 11010102 + 1011012 (ii) Subtract: 11010112 – 1110102
37. (a) Explain the types of ROM.
OR
(b) List out the points to be noted while creating a user interface for an operating system.
38. (a) Explain the versions of Windows Operating System.
OR
(b) Explain the fundamental gates with expression and truth table.
39. (a) What is an entry control loop? Explain any one of the entry-controlled loops with suitable
example.
OR
(b) Write a program to accept any integer number and reverse it.
40. (a) What are the advantages of OOP's?
OR
(b) What are the rules for operator overloading?

..36.. A. Prabhakar - 9442979144

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy