COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 1
Data Basics
Short Ques on: Long Ques on:
Q1: Differen ate btw data & informa on. Q1: Define data processing. What ac vi es are
Q2: What is Data? involved in data processing? Discuss in detail
Q3: What is informa on? Q2: What is file processing system? discuss
three problems/ disadvantages of tradi onal file
Q4: what do you know about data processing?
processing.
Q5: List different ac vi es involved in data processing.
Q3: Describe the file by usage point of view in
Q6: Define Data Capturing. detail?
Q7: Data Manipula on. Q4: What is file? Explain file by Storage point of
Q8: Differen ate btw master file & transac on file. view.
Q9: Write down the name of file from usage point of view. Q5: Define Database. Write down four major
Q10: What is difference btw program file & data file? component of database system in detail.
Q11: list file types from storage point of view. Q6: Define database. Discuss the objec ve of
Q12: What is meant by file organiza on? database system.
Q13: how data is stored in files? Q7: Define database model. Describe the
Q14: Define database. different Database Model.
Q13: what do you mean by data independence? Q8: Write down the objec ve of DBMS.
Q14: Write three examples of database system. Q9: Describe the feature of Database
Q15: What is difference btw file and database? management system.
Q16: What is basic purpose of data integrity?
Q17: Define data integra on.
Q18: Why hierarchical Model Considered like an
organiza on chart?
Q19: What is Database Model?
Q20: list different types of database Model.
Q21: what is basic difference between hierarchical and
network model?
Q22: Differen ate btw database and DBMS.
Q23: Define DBMS.
Q24: what is meant by data redundancy?
Q25: why is report generator used in database?
Q26: What is data dic onary?
COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 2
Basic Concept and Terminology of Database
Short Ques on: Long Ques on:
Q1: Define data handling in file management system. Q1: What is table or rela on? Write down the
Q2: Define the term table/rela on. proper es of rela on.
Q3: Describe any two proper es of table/rela on. Q2: What is key? Describe the different types of
Q4: What is an a ribute? Give example. keys used in database.
Q5: Define file, record and field.
Q6: Define En ty?
Q7: What is user or End user?
Q8: State the purpose of index file.
Q9: What is View?
Q10: Write the responsibili es of DBA in database system.
Q11: Write the responsibili es of Data administrator (DA).
Q12: Write the purpose of indexes.
Q13: Define primary key.
Q14: Define secondary key.
Q15: Define foreign key.
Q16: write down the Func on of Key.
Q17: Write a note on composite key.
Q18: Define Alternate key.
Q19: what is candidate key?
COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 3
Database Design Process
Short Ques on: Long Ques on:
Q1: What is the purpose of feasibility study? Q1: What is data modeling? Explain different
Q2: How is data analysis performed? ingredients of data modeling.
Q3: which ac vi es are involved in data analysis? Q2: What is ER diagram? Give an example of ER
Q4: What is project planning? diagram.
Q5: Define en ty.
Q3: what is database design? Briefly explain the
Q6: what is a ribute?
database design process with the help of
Q7: Define the term cardinality of rela on.
diagram.
Q8: Define Modality.
Q9: How can you define rela on in ER diagram? Q4: Write down the different components of a
Q10: Differen ate between cardinality & Modality. logical database design model.
Q11: list down different type of rela onship. Q5: Explain physical database design process.
Q12: define data Modeling.
Q13: What is ER diagram? Q6: Briefly describe basic data distribu on
Q14: Define implementa on in database. strategies?
Q15: what is purpose of logical database design?
Q16: What is Physical database design?
Q17: Write down the different phases of logical database
design.
Q18: List any four component of physical database design.
Q19: List down the data distribu on strategies.
Q20: Define integrity constraints.
Q21: what do you know by file organiza on?
COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 4
Data integrity and Normaliza on
Short Ques on: Long Ques on:
Q1: What is Data integrity? Q1: What is data integrity? Explain its types.
Q2: What is en ty integrity? Q2: What is first normal form? Explain in detail.
Q3: Define Referen al integrity.
Q4: what is meant by Normaliza on. Q3: What is normaliza on? Explain second
Q5: Define full Func onal dependency. normal form with example.
Q6: What is transi ve dependency? Q4: Define normaliza on? Explain the third
Q7: What is repea ng group? normal form.
Q8: what is 1NF?
Q9: Define second normal form.
Q10: When is the rela on is in first normal form?
Q11: Write down the condi on for a table to be in 2NF.
Q12: What is Par al dependency.
Q13: What is third normal form?
Q14: What type of anomalies occurred due to transi ve
dependency?
Q15: Define synonyms.
Q16: Define Homonym.
Q17: What is meant by redundancy?
Q18: What are Mutually Exclusive Data?
Q19: What are database anomalies?
Q20: Define inser on anomaly.
Q21: What is dele on anomaly?
Q22: what is modifica on / update anomaly?
COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 5
Introduc on to MS Access
Short Ques on: Long Ques on:
Q1: What is MS Access? Q1: What are advantages of using a Microso
Q2: State the use of MS Access. Access IDE?
Q3: What is RDBMS? Q2: Explain the following terms
Q4: Write down the advantages of RDMBS.
Q5: What is database wizard? 1- Form 2-Report 3- Table 4- Query
Q6: What is Toolbar in MS-Access?
Q7: What is Title bar in MS-Access?
Q8: What is main idea of Scroll Bar and Status Bar?
Q9: Differen ate btw Toolbar and Menu bar?
Q10: Describe any two bar of MS-Access applica on
window.
Q11: Define Database Objects.
Q12: Why Table object of Database is most important?
Q13: What is report?
Q14: Write down the uses of report.
Q15: differen ate btw form and report.
Q16: Differen ate btw table and query.
COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 6
Table & Query
Short Ques on: Long Ques on:
Q1: What is meant by degree of rela on? Q1: How would you define table? Also write
Q2: What is meant by cardinality of rela on? Characteris cs of table.
Q3: How many views in Access? Q2: What are field Proper es? Explain at least
Q4: Define field. three field proper es with an example.
Q5: Write down two characteris cs of table.
Q3: Explain the different Types of data types
Q6: List three methods for crea ng table?
available in MS- Access.
Q7: Describe the use of design view in MS-Access.
Q8: Define Datasheet view. Q4: Describe different methods of modifying
Q9: How database is created in design view? tables.
Q10: List out different data type available in MS-Access.
Q5: What is filter? Discuss different types of
Q11: What is Primary key? filters in MS-Access.
Q12: Define datasheet view.
Q13: How database is created in design view? Q6: What is Query? Discuss different types of
Q14: What is referen al integrity? queries.
Q15: Write use of OLE objects in MS-Access. Q7: What is Query? Write advantages of Query.
Q16: What is use of input mask?
Q17: write two differences btw rela onship and join.
Q18: What is meant by filter?
Q19: what is difference btw sor ng & filters?
Q20: Define query.
Q21: Define parametric query.
Q22: How record is stored in a query?
Q23: Name different types of queries use in database.
Q24: What do you know about select query?
Q23: What is difference btw cross tab and parametric query?
Q24: What is query wizard?
Q25: Write down some uses of query. Or advantages.
Q26: Differen ate between update and append query.
Q27: What is use of Wild Card?
COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 7
MS-Access Forms & Reports
Short Ques on: Long Ques on:
Q1: What is form? Q1: What is form? Explain its uses and
Q2: What is Columnar Form? advantage
Q3: Write a note on Tabular form? Q2: Discuss different op on for edi ng form in
Q4: What do you know about datasheet form? MS Access.
Q5: Why form object of database is used?
Q3: What is report? Briefly explain its Types
Q6: How is Form constructed?
and advantages
Q7: Write down some advantages of form?
Q8: List different types of forms in MS-Access.
Q9: What is sub form?
Q10: What are the uses of List Box?
Q11: Describe Radio Bu on?
Q12: Differen ate btw form and sub form?
Q13: What is Check Box?
Q14: How is combo box used?
Q15: List any five Bu ons available on Access database
window?
Q16: Difference between combo box and list box.
Q17: What is difference btw form and reports?
Q18: Write down some uses of reports.
Q19: How is report created by using wizard?
Q20: Define Report.
Q21: List any two advantages of using reports.
Q22: Define condi onal Forma ng?
Q23: What is linking?
Q24: Write the use of switchboard?
COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 8
Ge ng started with C
Short Ques on: Long Ques on:
Q1: Differen ate btw Structured and Unstructured Q1: What is programming language? Explain its
Languages. types.
Q2: Differen ate btw source code and object code.
Q2: How Would you define High level language?
Q3: Give any four examples of High-level Languages. Write common characteris cs of all high-level
Q4: What do you mean by machine independence? program languages.
Q5: Why source code cannot be executed directly?
Q6: What is assembly language? Q3: Write the detail Steps of Wri ng a program
in C language.
Q7: Define low level language.
Q8: Define Program. Q4: What is the basic structure of c program?
Q9: write down the use of Turbo C++ compiler. Discuss in detail.
Q10: Define IDE of turbo C++.
Q5: What is debugging? Explain all different
Q11: Why main Func on is important in every C language
types of errors uncovered by debugging
Program.
Process?
Q12: What is the usage of loader.
Q13: Define linker
OR
How executable file is created?
Q14: Write shortcut keys for Compiling and Running
program in C.
Q15: Write shortcut key for saving the C program.
Q16: what is difference btw linker and loader?
Q17: Write the use of define direc ve.
Q18: dis nguish btw compiler and interpreter.
Q19: Define header file.
Q20: What is the purpose of # sign?
Q21: Define main () func on.
Q22: write down the use of delimiter.
Q23: Write two uses of preprocessor direc ves.
Q24: Define statement terminator.
Q25: Define include direc ve.
Q26: What is constant Macro?
Q27: What is C-statement?
Q28: What is debugging?
Q29: Define bug and debugging.
Q30: What is Syntax error?
Q31: Define logical error.
Q32: Which type of error is difficult to trace and why?
Q33: What do you know about run me error?
Q34: What is the purpose of compiler?
COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 9
Elements of C
Short Ques on: Q29: Trace error from the code.
#include <stdio.h>
Q1: What is iden fier? void main();
Q2: What is Standard iden fier? { int x=5;
Q3: What is user defined iden fier? prin (%c, x);
}
Q4: Define keywords in C-Language.
Q30: Trace output
Q5: Give two examples of standard iden fier.
prin (“Pakistan \t is \n my\t homeland”);
Q6: Write the legal character for an iden fier.
Q31: Compare unary and binary operator.
Q7: Write C statement to declare integer variable x and
Q32: What will be the value of following code
assign any value to x.
prin (“%d”, ‘a’+’b’);
Q8: What is garbage Value?
Q33: Rewrite the statement x-=2 without
Q9: Differen ate btw declaring and defining a variable. compound assignment operator.
Q10: What is variable? Q34: What is use of increment operator?
Q11: what is mean of declaring a variable? Q35: rewrite the expression n++ without using
Q12:]Write down the C-Statement that ini alize character increment operator.
ch1,ch2,ch3 in one line. Q36: What is prefix and pos ix increment
Q13: What is meant by ini alizing a variable? operator?
Q14: Trace the error from following code Q37: What is decrement operator?
Int room #; Q38: What is meant by operator precedence?
prin (“%d”,5) Q39: Determine the output of following codes
Q15: Differen ate btw character constant and string. a) Int m,n,k;
Q16: Write down Three rules for naming a variable. m= 15, n=20;
Q17: What is Constant? k= m+n;
Q18: Write a note on long double type. prin (“k=%d”, --k);
Q19: List any two data type in C Language. b) Int x=10;
y=++x;
Q20: Find error
Int a=5 x=--y;
Int double= 20; prin (“%d”, y);
prin (“Result = %d”, double) c) Int n,a,b;
Q21: Determine the output. n= 400;
Int x=7; a=n%100;
Int y=3; b=n/10;
prin ( “%d and %d”, x/y, x%y); prin (“Result=%d %d”a,b);
Q22: Predict the output of following code. Q40: What will the value of x and y.
Int x=13; Int x=7;
Int y=3; Y=x++;
prin (“%d and %d”, x/y, y/x, x%y);
Q41: Define expression.
Q23: Why C is known as Strongly typed language.
Q42: What are comments?
Q24: Write a note on arithme c operator.
Q43: Define arithme c expression.
Q25: What is rela onal operator?
Q44: Define Lvalue and Rvalue.
Q26: Write a note on assignment operator.
Q45: What will be the value of x if
Q27: Define a logical operator in C-Language.
X=1+2%3-3;
Q28: Define compound condi on.
COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 10
Input and output
Short Ques on: d) float p= 79.23;
prin (“%10.1f”, p);
Q1: What is prin f func on also write its syntax? e) int a,b,c;
Q2: What is standard input? a=3;
Q3: Write the name Input func on in C-Language. b=a++;
Q4: Write a note on standard output. c=++a;
Q5: Write a single prin statement that show-> prin (“%d%d%d”, a, b, c);
C:\My document Q26: Trace error.
Q6: Define clrscr(). Int x;
Q7: List four format specifier used in C-language. scanf(“%d”, x);
Q8: What is Format specifier?
Q9: Write a C-statement that output Two Values in two
floa ng point variable a and b.
Q10: Write down the purpose of %c and %e format specifier. LONG Ques on:
Q11: What is meant by field width specifier?
Q12: How can you specify the field width specifier of integer? Q1: Explain the prin () func on with
Q13: How can you specify the field width specifier of floa ng example.
point?
Q2: Write a note on scanf() func on in detail
Q14: Why format specifiers are important to be specified in
I/O opera on? with example.
Q15: What is escape sequence?
Q16: Write down the name of four escape sequences.
Q17: Discuss the role of \n and \t
Q18: discuss the role of\b.
Q19: Why & operator is used in scanf() func on?
Q20: What is the use of scanf(). Write its syntax?
Q21: What is format string in scanf func on?
Q22: List two names of func on to get character input.
Q23: Write difference btw getch() and getche() func ons.
Q24: What does happen if & sign is missing in scanf()
func on.
Q25: Determine the Output.
a) Int x=0, y=5, z=4;
x=x+y*2;
y=x+y/2;
pr n (“%d%d”, x,y);
b) Void main()
{ prin (“555 it”):
prin (“999”):
prin (“In 444”); }
c) float p=3.1234;
prin (“%15.2f”, p);
COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 11
Decision Construct
Short Ques on: b) in x=1, y=3, z=3 ;
Q1: What is control structure? if ( (x==y) || (y==z) ||(z==2) )
Q2: How instruc ons are executed in sequence structure? prin (“Yes”);
Q3: What is selec on statement? else
Q4: What is the limita ons of simple if statement? prin (“No”);
Q5: write the output of following code c) if ( 2==4 )
If (50<20) prin (“Punjab”);
prin (“ABC”); else
prin (“DEF”); prin (“KPK”);
d) if ( 100>50 )
Q6: What is i-else statement? ( why if-else statement is
used)? prin (“ONE”);
else
Q7: Write the syntax of if-else statement.
prin (“TWO”);
Q8: convert the following in if else
LONG Ques on:
X< 0 ? y=10 : z=20;
Q9: Determine the output Q1: What is the control structure? Briefly
Int x =10; explain the basic control structure for
(x% 2 ? prin (“even”) :prin (“odd”)); wri ng programs.
Q10: Write the expression for following in C-language. Q2: Explain nested if statement with its
a) Y is grater than x and less than 2. purpose, Syntax flow chart and suitable
b) Marks are grater than 70 and less than 80. program
c) Temperature is between 25 and 35.
d) W is either equal to 6 or not greater than 6.
Q3: Define and explain If-else statement.
e) Age is greater than equal to 20. Q4: Write a program that inputs three
f) Speed is not greater than 65. number and find the smallest number using
g) Temperature is less than 40.00 and greater than nested if.
25.00 Q5: Write a program that accept three
Q11: What is nested if statement? Write its syntax. number from user and display the largest
Q12: What is if-else if statement? number using nested if.
Q13: What is meant by condi onal operator? Q6: Define if- else if statement. Explain its
Q14: Write the syntax of switch statement. working with syntax, flow chart and give an
Q15: Why brake statement is used in switch () structure?
example.
Q16: What is the purpose of default statement in switch
Q7: Write a program that display largest
structure?
number using if-else if.
Q17: trace the output of following codes.
a) Int k=8, m=7, z; Q8: Write a program that input a weekday
Z=k ? k++ : m++; number and print the name of the day.
prin (“%d”, z); Q9: Write a program that input a character
b) Int p=3, q=5; and check whether it is a vowel or not using
If ( (p>q) ||(p!=4)) switch statement.
{ p=p+1;
Q10: What is switch statement? explain its
q=q+1;
working with flow chart syntax and an
prin (“%d, p-q); }
example.
COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 12
Loop Construct
Short Ques on: Long Ques on:
Q1: What is meant by loop? Q1: Define while loop? Write its syntax and
Q2: Define infinite loop. flow chart. Also explain it working with the
Q3: Define while loop.
help an example.
Q4: Write down the use of loop.
Q5: What is the syntax of While loop? Q2: Write a program to print odd number 1
Q6: Write a program to display first ten natural number by to 10 using while loop.
using while loop. Q3: Write a program that prints the following
Q7: What is do -while loop?
series using loop:
Q8: Differen ate between While and do-while loop.
Q9: Write the first ten odd number by using do-while loop. 19 16 13 10 7 4 1
Q10: What is for loop? Q4: Write a program that get star ng and
Q11: What is syntax of for statement? ending number then print coun ng in
Q12: What is the role of test condi on in for statement?
between these numbers using while loop.
Q13: Write a program to print digit 1 to 10 using for loop.
Q14: Write a note on counter control loop. Q5: Write a program that input a number &
Q15: What is nest loop? print its table by using loop.
Q16: What is loop control variable? Q6: Write a program that show the sum of
Q17: Why is sen nel value used in loop?
following using any loop
Q18: Define sen nel loop.
Q19: Define goto statement. 1+1/2+1/3+1/4+………..+1/100.
Q20: Convert the following for loop in while loop. Q7: What is do- while loop? Explain its
Int m; working with example.
for (m=10; m<5; m--)
prin (“%d\n”, m); Q8: Write the first ten odd number by using do-
Q21: Convert in do while. while loop.
a) Int a; Q9: Define for loop. Write its syntax and flow
for (a=1; a<=25; a++) chart. Explain its working with example.
{ prin (“%d\n”,m); Q10: Write a program that display coun ng
a++; } 10 to 1 using for loop.
b) i=1;
Q11: Write a program that input a number
While( i<=4)
{ from user and find its factorial.
prin (“world”); Q12: Write a program that print
i++; } 0 2 4 6 8 10 12 14 16
c) int I; Q13: write a program which print the sum of
for ( I=3; I<=39; i+=6) following series
prin (“%d\n”, I);
1+4+9+16+25+……. +256.
d) int m=10;
for ( m=8; m>=1; m--) Q14: write a program in to print the given
prin (“%d”, m%2); series 0 3 6 9 12 15
Q15: Write a program to display the
following series using loop. 1 4 9 16 25
Q16: What is nested loop? Write its syntax
and explain its working, flowchart and
example.
COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 13
Func on in C
Short Ques on: Long Ques on:
Q1: Define Func on. Q1: What is func on? Write the types and
Q2: Write about unstructured programming languages. importance of func on.
Q3: Describe Structure programming.
Q4: Write any two benefits of func ons. Q2: Explain wri ng func on in C languages.
Q5: Why func on used in program? Q3: What are local variables, Explain life me
Q6: Give an example of user defined and built in func on. and scope of local variable.
Q7: List different type of func on.
Q4: What are global variables, Explain
Q8: Define func on declara on with its syntax.
Q9: How func on is ac vated? life me and scope of global variable.
Q10: What is func on call? OR How func on is ac vated? Q5: What is meant by func on without
Q11: What is func on header? argument? Write func on return a value and
Q12: What is func on defini on? accept argument.
Q13: Write a note on func on body.
Q14: What is return statement?
Q15: What is func on prototype?
Q16: Define scope of variable.
Q17: Write a difference between Global and Local variable.
Q18: Define automa c variable
Q19: Define global variable.
Q20: difference between actual & formal parameters.
Q21: What is meant by func on without argument?
Q22: what is actual parameter?
Q23: what is formal/dummy parameter?
COMPUTER SCIENCE (2ND YEAR)
CHAPTER # 14
File Handling in C
Short Ques on: Long Ques on:
Q1: What is stream? Q1: What is array and string explain with
Q2: Write down the type of stream in file handling. examples.
Q3: What is text stream?
Q4: Define EOF marker. Q2: Why it is necessary to open a file? Write
Q5: Compare text and binary stream. different modes of opening a file.
Q4: Differen ate between newline and EOF. Q3: What is stream? Explain different types
Q5: Define file pointer? of streams.
Q6: Write the syntax of fopen () func on.
Q7: Why it is necessary to open a file.
Q8: What is meant by closing a file.
Q9: How file is opened?
Q10: How file is closed?
Q11: What is string?
Q12: Define array in C language.
Q13: What is string assignment?
Q14: What is fgets() func on?
Q15: What is fputs () func on?
Q16: What are the names of func on that are used for
forma ed I/O in C Language.