2nd Year Computer Science Past Papers Zahid Notes
2nd Year Computer Science Past Papers Zahid Notes
q) (D) Test (0) Infinite loop (©) keyword (0) Cache (0) String (0) None (D) many (D) input box (0) Nested If (P) Not(p>q)[Rott No. To be filed in by the candidate Computer Science ¢ssay type) Inter(Part- 42018 Session;2014-2016 Time: 3:10 Hours Marks: 83 7 Section -I . MS-ACCESS 2. Write short answers of any eight parts from the following. 2x8 =16 1, Distinguish between chekbox and radio button, «li List any two properties of a relation. v. Name any four data types available in MS Access. vil. How is referential integrity achieved? ix. Write any two advantages of using RDBMS. Differentiate between secondary key and primary key. iv. Whats the purpose of logical database design? vi. State the purpose of using normalization. vill, State the purpose of using reports in MS Access. x. Name two table views available in MS Access. Differentiate between data redundancy and data inconsistency. xi, Write eny two constraints for selecting a file organization. C-Language 3. Write short answers of any eight parts from the following. i. Briefly describe delimiter? What are run-time errors? ¥. Find errors in the following code statement. include‘void main (}; { Printf(’Pakistan);, } Find out the output of folowing expression 20°(10/5-3))+13 ix, Define printf and scanf function xi, Predict the output of following. é Print (Pakistan\n Goodin County 4. Write short answers of any six parts‘from the foll i. List different types of control structures in C-language. ii. Trace the error from following code segment, int a,b,c; i(aseb==1), Printi(%d",0); ¥v. Write the output of the foliowing code inte=1;, do printf ("6a While (c++<=4); vil. What is function call? ~ ix. What is text file? x 2x Differentiate between syntax error and logical error? iv. Distinguish between implicit and explicit type casting, vi. Find errors in the following assignment. int abcd: char grade; s “Vili, Differentiate between gets and puts function x. Define assignment statement. xi, Preset output ofthe folowing: Prinif (‘Welcome \t to \t Lahore” 2x6 =12 Differentiate between break and continue statement. iv. Change the following code into while loop. int for(i jester Pakistan’); =10;i+) vi. Trace the error in the following code segment. inta for(a=1; ac=10; +4); Printf(%6f",a); vill, Define function Header.OR Visual Basic 3. Write short answers of any eight parts from the following. 2x8 =16 Define structure Programming, Why we need translators. Differentiate between property and method. Define integrated development environment. List down any two controls. vi. Describe the purpose of code window. vii. How are event procedure named. vill, Distinguish between keydown and keyup events, Describe Load method x. Find out errors in the following code. Ainleger ‘A=Contnt(TextB0. Msg) ‘Write down output of the following code. Write down output of following code. Dim a As Integer Dim a,b As Integer 0 220 Print alt0 6 Print’alb="Balb Print'aModb="SeModb 4. Write short answers of any six parts from the following, 2x6=12 i. Define Nested loop in Visual Basic Ui, What is index in an Array? Differentiate between-"Dim" and "Redim" iv. What is textile? v. Define For-NEXT loop working? vi. What is control array? vii. List three properties of Combox Box control vil. Write two Focus events. ix. How a function is called(invoked) in Visual Basic? Section -IT MS-ACCESS Note: Attempt only one question from the following. Bxt=8 '5. What is a key?Descrive any three types of keys used in database. 08. 6. Discuss different methods of modifying a table. 08 Section -IIT_ Note:Attempt any two questions either from "C-language” or "Visual Basic”. Bx2=16 C-language 7. What is the difference among Compiler Assembler and Inf@rpreter?Also give one example of a language in 0B which they are used. x 8. Write a program in C language that inputs three nugibers and finds maximum of them. 08 9. What is "While" loop? Write the syntax and drayits flowchart Expiain its working with example. 08 sual Basic 7. Write down the difference among complier,assembler and Interpreter?Aiso give one example of each 08 8. Write a program in VB that inputs three numbers and finds maximum of them. 08 8. What is "Do...While...Loop?Write the syntax and draw its flowchart. Explain its working with example. 08 Section-IV (Practical) BxS=15 Note: Answer any three parts from the following. 40(A). Write a procedure to create a form in MS-Access. B. Write a procedure to create a report in MS-Access. CC. Write a program in C or VB that inputs radius ofa circle and finds its area of circle by formula, A= 7 D. Write a program in C or VB that prints even integers from 10 fo 20 using for loop. E. Write @ function in C or VB that takes value of a variable as argument and returns its cube. 718-012-A-toe Inter@Port 1-8-2019 |Roll No.___re be fitted in by the candidate (For all sessions) Computer Science (objective Type) Time: 20 Minutes NOTE: Write answers to the questions on objective answer sheet provided. Four possible answers A,B,C & D to each ‘question are given. Which answer you consider correct, fil the corresponding circle A,B,C of D given in front of each question with Marker or pen ink on the answer sheet provided. 10. 4 12, 18, 14 16. 10. " 12 23 14. 16. 637-012-A-WHr He Paper Code | 8 | 8 | 3] 5 Marks: 15 (D) Many (0) Too! (0) Database (D) Tuple (0) Relationship (0) Partial (0) exit (0) for {D) Hard disk (0) File pointer (0) Logical error (0)! (2) (0) switch statement os () END (0) FOR...NEXT (0) 3 (0) Method (0) Load (D) Date (0) Ok only MS-ACCESS . The maximum number of tables in @ database are: (A) 01 (B) 02 {c) 03 In MS-Aocess, Find and replace command is found in: (A) File menu (8) Edit menu (©) View menu The logical grouping of characters is (A) File (8) Record (C) Field A virtual table that is constructed from other tables is called: (A) view (B) Table ({C) Relation In an ER diagram,a diamond represents: (A) Entity (8) Attribute “© File Which form of dependency is removed in 3NF? (A) Full Functional (B) Non-Funetional (C) Transitive C-Language ‘Which statement causes a loop to terminate early? (A) End (B) terminate (C) break Which of the following is a loop statement in C? (A) It-else-if (B) switch (C) itelse Giobal variables are created in: (A) ROM (B) RAM (C) Caches (On successfully closing a file in C,the felose() retums: s {A) 0 (zero) (B) NULL Division by zero (e.g, 6/0) is an exemple of < (A) Compiler error (8) Run time error 46) Syntax error Which of the following operators has lowest precedente’ (A) = (8) + a ©* The escape sequence for backlash is: s (ay (8) \o " (oe Anif statement inside another if statement is called (A) if statement (B) if-else statement (C) Nested if statement ‘When a relational expression is false, it has the vaiue: (Ayo (4 (co) 4 OR Visual Basic The statement that will immediately terminate a FOR...NEXT loop is: (a) EXIT (8) Terminate (©) Exit For Which of the following is a loop statement in visual basic? (A)IF..qThen..Eise(B) IF..ELSE (©) IF..ENDIF How many options can be selected if @ frame contains four option buttons? (ayo ®)1 (c) 2 Data can be entered in a control only when it has: (A) Focus (8) Mask (C) Event Which event detects the pressing of standard displayable character? (A) Keyboard (B) Keypress (C) Click ‘Which datatype is used to handle a Yes or No response? (A) Boolean (B) Short (C) Integer The default message box style is: (A) Retry cancel (B) Yes No Cancel (C) Yes No IF...END IF statement inside another IF statement is called: (A) IF_..END IF statement (6) IF...Then statement (C) Nested IF statement () IF.,.ELSE...IF The expression 15 MOD 4 has a value equal to: (A)3 (By) 5 () 7 (8Inte Port 2019 Roll No. Tobe filled in by the canaidato| (FOr all sessions) Computer Science éssay type) ‘Time: 2:10 Hours . Marks: 60 Section -1 Ms-ACCESS 2. Write short answers of any six parts from the following. 2x6 =12 i. List file names from usage point of view. Who is a data administrator? + ii, Define attribute with exemple. jv. Why is Normalization used? ¥. Define data integrity Vi. Define form. State the use of wild cards. ‘What ate check boxes? Differentiate between data redundancy and data inconsistency. C-Language 3. Write short answers of any six parts from the following. 2x6 =12 Write the purpose of define directive. lil, What is the purpose of include directive? v. What is compound condition?Give an example. vil. Find errors include void main ( void ) ix. Write the use of printf( ) function with an example. 4. Write short answers of any six parts from the following, iDetermine the output 0) unjab");, printf ("Sindh"); i. Define compound statement. Vv. Determine the output int do { printf ("%d \n',n); nt; 3 While (nee! vii. Why is function used in program? ix. Compare binary and text stream, ji, Why do you include "stdio.h" header file in c-program? iv, Determine output of the code. int int y= Printi("%od \t %" xSby,x/y); vi. How an arithmatic overflow occurs? viii. Determine the output of the following code, infS=10; gp Iht b=12; SS inte; 2x6 =12 ii, Find the error Void main () { Far (int printf"%dn); } iv. What is nested loop? Vi. Find the error void main () IEF Uy printt("%ed" y);, } Describe function definition,OR Visual Basic 3. Write short answers of any six parts from the following. 2x6=12 4. What is program? li. Which language translator is used in visual basic? How visual basic code is executed? lv. Define the purpose of code window. Vv. Whatis difference between project and form Vi. Define event and method, vil, Determine the output. vill. Find ertors in the code. DIM x As Integer DIMx As float x=713 x35 print x xHe7.0 ‘x. What is active-x control? 4. Write short answers of any six parts from the following, 2x6 =12 What is nested loop? Determine the output i, Define compound statement, fil. Find the error Dim y=10; as integer Dim n=1 as integer, IFF y=6 than do print y print n nenet Loop Whiten: v. Determine output Vi. Find t68 error if (7%3=0) then 32° _DIMn=1 as Integer print ("Punjab'y; SS Form=t105 else RS print n print(*Sindh’); viii. Describe function definition. vil. Why is function used in program? ix. Compare binary and text stream, | Section -It MS-ACCESS Note: Attempt only one question from the following. oxt=8 5. Define data modeling.Explain ingredient of data modeling. 08 6. List down different data types in MS-Access, Discuss four data types. 08 Section -IIT Note:Attempt any two questions either from "C-language” or "Visual Basic", ax2=16 C-language 7. Define data type and describe three types in deta os | 8. Write @ program in C tanguage that inputs 2 number and finds whether it is positive, negative or zero 08 | 9. Define while loop and diferentiate while and do-whie loop in detail os Visual Basic | T. Define data type and describe three types in deta oe 8. Write a program in Visual basic that inputs a number and finds whether it is positive,negative or zero. 08 ‘9. What is Do-While loop?Discuss. flowchart,syntax and example of Do-While loop in detail, 08 638-012-A—Inter-(Part-II)-A-2021 Ww 7 : Roll No. To be fitled in by the candidate | (For all Sessions) | Paper Code [sfela|a| Computer Science (Objective Type) Time: 20 Minutes Marks:15 NOTE: Write answers to the questions on objective answer sheet provided. Four possible answers A,B,C & D to each question are given.Which answer you consider correct, fill the corresponding circle A,B,C or D given in front of each question with Marker or pen ink on the answer sheet provided. MS-ACCESS 4.1. Arithmetic manipulation of data is known as: (A) Summarizing (B) Classifying , (C) Sorting (D) Calculations 2. Anattribute is also known as: (A) Field (B) Table (C) Row (D) Relation 3. In ERD Model,the relationship between two entities is represented by a: (A) rectangular box (B) oval symbol (C) diamond symbol (D) line 4. Every relation must have a: (A) candidate key (B) primary key (C) secondary key (D) alternate key 5. Which of the following object of database is used to retrieve data from database? (A) Queries (B) Forms (C) Reports (D) Tables 6. Areferential integrity constraint is a rule that maintains consistency among the: (A) columns of two tables (B) two columns of same table (C) rows of two table (D). attribute of two tables C-Language 7. Every statement in aC program terminates with: ~ (A) Colon (B) Semicolon (C) Delimiters (D) comma 8. Preprocessor directives are commands for: (A) Microprocessor (B) Language processor (C) Loader (D) C preprocessor 9. Which of the following operators has lowest precedence: (A) = (B) ! (C) == (D) + 10. The logical not operator,denoted byl, is a: (A) Uniary operator (B) Ternary operator (C) Binary operator (D) Bitwise operator 41, The escape sequence for Tab is: (A) \f (B) \n (C) \r (D) \t 42. The format specifier %f is used for: ‘ (A) Character (B) Integer (C) Double (D) Float 43. A compound statement refers to a group of statements enclosed in: (A) () (B) {} (C) [] (D) "" 14. A loop inside the body of another loop is: (A) For loop (B) while loop (C) nested loop (D) infinite loop 45. Function prototypes for built-in functions are specified in: ‘ (A) source files (B) header files (C) object files (D) image files 637-12-A-1—--Inter-(Part-II)-A-2021 Roll No. To be filled in by the candidate | (For all sessions) Coniputer Science Essay type) Time: 2:10 Hours Marks: 60 Section-| (MS-ACCESS) 2. Write short answers of any six parts from the following. 2x 6 =12 i. List two properties of relation. ii. What do you mean by primary key? iii. Define data modeling. iv. What is cardinality? v. How is MS-ACCESS loaded? vi. What are reports? vii. What is Join?Write its purpose. viii. Write uses of query. ix. Write two advantages of using a microsoft ACCESS IDE. (C-Language) 3. Write short answers of any six parts from the following. 2x 6 =12 i. Why is C known as strongly typed language? ii. Describe header file. iii. Write shortcut key to run a C-program. iv. Give any four examples of valid variable names. v. Differentiate between constant and variable. vi. What is high level language? vii. Determine the output of the following code viii. Find errors in the following code segment: int P=20 int m=0, n=5; if(P > 5) if(m%n>1) printf("OK"); printf("Success"); else printf("Failure"); ix. Write an expression in C-language for the given statement: age is from 18 to 25. 4. Write short answers of any six parts from the following. 2x6 =12 i. Write the syntax of printf and scanf functions. ii. Define the term stream in context of file handling. iii, What is meant by character input in .© iv. Find the errors in the following code segment. - C-programming language? oe a=10; Avg=0; While(a<=10); Avgt=a v. Trace the output of the following piece of code. vi. Determine the output of the following code segment. for(int x=1;x<=10;x=x+4) int j=5; printf("%d\n",x); While(j<=15) { printf("Pakistan\n") jFj+2; } vii. Write down any two benefits of functions. viii. What is meant by scope of variable? ix. Enlist escape sequences used for different purposes. Section -II (MS-ACCESS) 8x1=8 Note: Attempt only one question from the following. 5. Write four major components of database system. 08 6. Define functional dependency.How do partial dependencies affect a relation? 08 Section -III (C-language) 8x2=16 Note: Attempt any two question from the following. 7. Define programming language.Discuss two main types of programming languages. 08 8. What is control structure?Briefly describe basic control structures of C program. 08 9. Write a program that prints odd numbers between(1 to 100) using for loop. 08 638-12-A-----