Trending ▼   ResFinder  

CBSE Pre Board Class 12 2017 : Computer Science (Army Public School)

10 pages, 27 questions, 6 questions with responses, 6 total responses,    2    0
Somnath PaulChoudhury
St. Mary's ICSE School, Koparkhairane, Navi Mumbai
+Fave Message
 Home > spch >   F Also featured on: School Page cbse12_pre_boards

Formatting page ...

Army Public School Bengdubi Pre Board Examination 2016-17 Class XII Science Sub: Computer Science Time 3 hours Max Marks 70 General Instructions: i). All Questions are compulsory, programming language is C++. ii). 15 minutes time has been allotted to read this question paper. ------------------------------------------------------------------------------------------------------------------------------------1. [1+1+2+2+2+2+2=12] a. Why function prototypes are required? b. Observe the following code and write the name(s) of the header file(s), which will be essentially required to run it in a C++ compiler: int num; cin>>num; char string[50]; itoa(num, string, 10); cout<<setw(20)<<num<<" "<<setw(30)<<string; cout<<num<<" "<<string; c. Observe the following C++ code carefully and rewrite the same after removing all syntax error(s) present in the code. Ensure that you underline each correction in the code. #include<iostream.h> #include<string.h> void strfunc(char str) { strcopy(str,"Computer Science"); cout<<str<<endl; } void main { char *str='CS 083'; strfunc[str]; cout<<str; } d. Find the output if following C++ sequence is run in compiler #include<iostream.h> #include<conio.h> void main() { clrscr(); int L[]={10,15,20,25,30}; char *Hello="Sim1", *Hi="Sim2"; int *p=L; while(*p<30) { if(*p%3!=0) { *p=*p+2; cout<<Hello<<*p<<endl;} else { *p=*p+1; cout<<*Hi<<*p<<endl;} } getch(); } e. Find the output if following C++ sequence is run in compiler #include<iostream.h> #include<conio.h> void change(int arr[], int Ct) { for(int C=0; C<Ct; C++) arr[C]= arr[Ct - C - 1]; } void main() { clrscr(); int X[]= {11, 21, 31}, Y[] = {10, 20, 30}, Z[]= {1, 2}; change(X,3); change(Y,3); change(Z,2); for(int L=0; L<3; L++) cout<<X[L]<<"@"; cout<<endl; for(L=0; L<3; L++) cout<<Y[L]<<"*"; cout<<endl; for(L=0; L<2; L++) cout<<Z[L]<<"$"; cout<<endl; getch(); } f. Based on the following C++ code, find out the expected correct output(s) from the options (i) to (iv). #include<iostream.h> #include<math.h> #include<conio.h> #include<stdlib.h> #define Change(X, Y) pow(X, 2)+pow(Y, 3) void main() { clrscr(); randomize(); int A=random(5), B=random(4), Output; Output=Change(A,B); cout<<"Output : "<<Output<<endl; getch(); } i. ii. iii. iv. g. 5 6 7 43 Find the output, assume all header files present. void Position(int &C1,int C2=3) { C1+=2; C2+=Y; } void main() { int P1=20, P2=4; Position(P1); cout<<P1<< , <<P2<<end1; Position(P2,P1); cout<<P1<< , <<P2<<end1; } 2. [2+2+4+4=12] a. Which type of inheritance is shown below? Explain how the protected and public members of class C is accessible from class A? #include<iostream.h> #include<conio.h> class B { private: int b; protected: int bb; public: int bbb; }; class C { private: int c; protected: int cc; public: int ccc; }; class A:public B, protected C { public: void AA() { cc=9; ccc=11; cout<<cc<<" "<<ccc; } }; b. How can we access the data members cc and ccc from the main() function? Rewrite the main() method. void main() { clrscr(); A a; // object of class A a.cc; //compiler error a.ccc; //compiler error getch(); } c. Define a class libmast with the following specifications that will read from lib.dat that is created from objects of libmast private data members accno integer book_name 20 characters author_name 20 characters no_of_pages integer price float price_per_page() a function that calculates and returns price per page public functions getdata() a function that accepts all values and invokes the function price_per_page() showdata() a function that displays all values fatbooks() a function that calculates all books whose no_of_pages is more than 1000. d. Consider the following to answer the questions below: class AA { private: int a; float aa; protected: char aname[55]; public: char aaname[65]; void a_getdata(); void a_showdata(); }; class BB:protected AA { int b; float bb; char bname[45]; protected: void spc_it(); public: void b_getdata(); void b_showdata(); }; class CC:private AA { char cname[35]; int c; float cc; public: void c_getdata(); void c_showdata(); }; (i) How many bytes will an object of class AA have? (ii) How many bytes will an object of class BB have? (iii) Which functions are accessible by objects of class CC? (iv) What type of inheritance is shown above? Name the data members accessible by an object of BB and AA class. 3. [3+3+2+2+2+2=14] a. Write a function in C++ which accepts an integer array and its size as arguments and replaces elements having odd values with thrice its value and elements having even values with random numbers between 15 and 21. b. A two dimensional array P[20] [50] is stored in the memory along the row with each of its element occupying 4 bytes, find the address of the element P[10] [30], if the element P[5] [5] is stored at the memory location 15000. c. Write a function in C++ which accepts a 2D array of integers and its size as arguments and displays the elements which lie on diagonals.[Assuming the 2D array to be square matrix with odd dimension i.e. 3*3, 5*5, 7*7 etc .] d. Convert the following infix into postfix expression. Also show the status of stack after each operation. (M + N * O - P) / ( Q * R ) e. Write the definition of a member function PUSH( ) in C++, to add a new book in a dynamic stack of BOOKS considering the following code is already included in the program : struct BOOKS { char ISBN[20], TITLE[80]; BOOKS *Link; }; class STACK { BOOKS *Top; public: STACK(){Top=NULL;} void PUSH(); void POP(); ~STACK(); }; f. Write a function Rec_Insert() in C++ to perform insert operation in a circular queue which contains book no and book name(representation below) struct book { int bno; char bname[25]; }; 4. [1+2+3=6] a. Write a definition for function COSTLY( ) in C++ to read each record of a binary file GIFTS.DAT, find and display those items, which are priced more than 2000. Assume that the file GIFTS.DAT is created with the help of objects of class GIFTS, which is defined below : class GIFTS { int CODE;char ITEM[20]; float PRICE; public: void Procure() { cin>>CODE; gets (ITEM);cin>>PRICE; } void View() { cout<<CODE<< : <<ITEM<< : <<PRICE<<endl; } float GetPrice(){return PRICE;}. }; b. Write function definition for TOWER( ) in C++ to read the content of a text file architecture.txt, count the presence of word TOWER and display the number of occurrences of this word. Ignore case. The word must be an independent word. c. Given a binary file "bus.dat", containing records of the following class bus type. class bus { int bus_no; char desc[40]; int distance; //in km public: void read( ) { cin>>bus_no; gets(desc) ; cin>>distance; } void display( ) { cout<<bus_no; puts(desc); cout<<distance; } int retdist( ) { return distance; } }; Write a function in C++ that would read the contents of file "bus.dat" and display the details of those buses which travels the distance more than 1000 km. 5. a. [2+1+1+1+1+1+1+1+1=10] What is a Primary key? Define degree and cardinality of a relation. Identify possible primary key, degree and cardinality of the table below. loan_number L001 L002 L003 L004 branch_name bengdubi siliguri siliguri bagdogra amount 55,500 7,50,000 3,00,300 55225 b. Write SQL queries / find output on the basis of the tables account and depositor account ac_no A001 A002 A003 A004 A005 A006 branch_name bengdubi bengdubi siliguri bengdubi bagdogra bagdogra balance 15,000 23,000 17,000 2,00,000 2,15,000 3,10,000 depositor customer_name sine sec cot cosec cos ac_no A001 A002 A003 A004 A005 To display sum of balance group by branch_name. To display all records in account in descending order of ac_no. Count of records where branch_name is "bengdubi" To display all details from both tables where ac_no is A001 select * from account where branch_name="siliguri"; select ac_no, balance*2 as new_balance from account; select ac_no, customer_name from account a, depositor d where a.ac_no=d.ac_no and balance >200000 8. select max(balance), min(balance) from account 1. 2. 3. 4. 5. 6. 7. 6. [2+2+1+3=8] a. State the dual of the absorption law x + x' . y = x + y and prove it by truth table or algebraically. b.Draw the logic diagram for the Boolean expression (X + Y') . (X' + Y) . (X' + Y') using basic logic gates. c. Write SOP form of the Boolean function F represented by the truth table as below X Y Z 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 F 1 1 0 1 0 1 0 0 d. Reduce the following expression using K-Map X(a, b, c, d) = (0, 1, 3, 5, 6, 7, 10, 14, 15) 7. [1+1+1+1=4] a.What is a Gateway? b. Name few popular server side scripting languages. c. What is FLOSS? d. What is data encryption and firewall? e. [1+1+1+1=4] Tech up Corporation (TUC) is a professional consultancy company. The company is planning to set up their new offices in India with its hub at Hyderabad. As a network advisor, you have to understand their requirement and suggest to them the best available solutions. There queries are mentioned as (i) and (iv) below you have to understand their requirement and suggest to them the best available solutions. Their queries are mentioned as (i) and (iv) below. Physical locations of the blocks of TUC Conference Block Finance Block Human Resource Block Block to block distances (in m.) (Block From) Block (To) Distance Human Resource Conference 60 Human Resource Finance 120 Conference Finance 80 Expected number of computers to be installed in each block Block Computers Human Resource 125 Finance 25 Conference 60 (i) What will be the most appropriate block, where TUC should plan to install their server? (ii) Draw a block to block cable layout to connect the buildings in the most appropriate manner for efficient communication. (iii) What will be the best possible connectivity out of the following, you will suggest to connect the new setup of offices in Bangalore with its London based office? Infrared Satellite Link Ethernet Cable (iv) Which of the following devices will be suggested by you to connect each computer in each of the buildings? Gateway Switch Modem ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Formatting page ...

Top Contributors
to this ResPaper
(answers/comments)


Eshant Mahale

(6)

ResPaper Admins

(1)

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2025 ResPaper. Terms of ServiceContact Us Advertise with us

 

spch chat