University Of Peshawar Computer Science (Part-II) Paper-C 2003 Time: 3 hrs
Maximum Marks: 25
Note: Attempt any FIVE questions selecting TWO questions from section-A and three from section-B. All questions carry equal marks. SECTION-A Q.1 Q.2 a). b). c). d). e). Q.3 Q.4
a). b). c).
What is data model? Explain with examples different database models. Compare and contrast the following: Composite Key and Compound Key. Primary Key and Foreign Key. Security and Integrity. Logical Model and Physical Model. Database Approach and Traditional Approach. What is relational Algebra? Explain with examples the selection and projection process in relational algebra. Consider the Following Table: CUSTOMER C-No Name City Balance Age 010 Ali ISB 1000 30 0120 Akbar LHR 2000 35 030 John LHR 1500 40 040 Khan PSR 5000 28 050 Safeer LHR 500 45 Write SQL queries for the following: List out those customers whose balance is greater than 2000. List Names of Lahore-based customers. List out the customers whose balance is less than 2000 and not living Islamabad. SECTION-B
Q.5
What is meant by Object Oriented Programming? What are its advantages over structured programming?
Q.6
Define and explain the following terms with examples: a). Class b). Objects c). Single Inheritance d). Constructor d). Destructor Q.7 Write a program-using constructor to find the slope and length of a straight line. Q.8 What is meant by overloading? Write an OOP to overload prefix operator to decrement the value of a member variable count. Q.9 a). Write a statement that defines an array called many birds that holds 20 objects of type bird. b). What is the purpose of scope resolution operator? c). How do you make a class member visible outside the class? Q.10 Write short notes on any two of the following a). Polymorphism b). Level of Inheritance c). Friends Functions. ------------------------------------------