High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Page 1 of 9
ANSWER ALL QUESTIONS (20 MARKS EACH)
1.
a.
Given that the first 3 terms of a Geometric Progression are 12, 6 and 3
respectively, find the:
i.
common ratio,
( 1 mark )
ii.
sum of the first 5 terms,
( 2 marks )
iii.
sum to infinity.
( 2 marks )
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Topic 1: Review of Basic Algebra
1 Indices (exponents) and Surds
Given a positive integer n, an is defined as
an = a x a x a .a ( n times)
a is called the base, and n , the index or exponent or power
Example: 54 = 5 x 5 x 5 x 5 = 625
We shall restrict our
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Tutorial 3: (Arithmetic and Geometric Progression)
1. Arithmetic Progression
1.
Find the common difference and the first term of each of the following arithmetic
progressions:
(a) 3rd term = 20, 12th term = 56
19
79
, 20th term =
12
12
n
(e) nth term = 5
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Topic 3: Set Theory
A set is a collection of welldefined elements (objects).
We normally use capital letters A, B, X, Y to denote set , and lowercase letters a,b,x,y to
denote elements of the set .
Example 1 : The set F = cfw_apple, orange , pineapple
Ex
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Tutorial 7: (Probability)
1. Probability Theory
1.
In a box of highlighters there are eight which have dried up and will not write.
The box contains 10 red, 15 blue, 5 green and 10 yellow highlighters
A highlighter is picked at random from the box. Find t
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Tutorial 4: (Arithmetic and Geometric Progression)
1. Summation Notation
4
1.
ar :
In each of the following, find the value of
r 1
(ii) ar = r2 + 3
(i) ar = 3r+1
(iii) ar= 2 +
(v) ar=
2.
r
1
r
Use the
(iv ) ar = 2r+1
(vi) ar = (1)r22r1
notation to expre
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Tutorial 2: (Review of Basic Algebra)
1. Logarithm : Basic concepts and techniques
1.
2.
Convert the following to logarithmic form
1
9
(a) 24 = 16
(b) 32 =
(c) 100 = 102
(e) 2x = p
(d) a3 = y
(f) x4 = 2k
Convert the following to index form:
1
4
(a) 3 =
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Tutorial 8: (Discrete Probability Distribution)
1.
Two balanced dice are rolled. Let X be the sum of the two dice.
a) Obtain the probability distribution of X.
b) Find the mean and standard deviation of X.
Ans: b) mean = 7, standard deviation = 2.41
2.
Th
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Tutorial 10 : (Logic and Propositional Calculus)
1.
Let p denotes He is rich and let q denotes He is happy. Write each statement
below in symbolic form using p and q. Note that He is poor and He is unhappy
are equivalent to p and q respectively.
(a) If he
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Topic 2: Arithmetic and Geometric Progression
1 Arithmetric Progression (AP)
Examine the sequence of numbers 1, 3, 5, 7, 9. . Notice that each number other than the first
is obtained from the preceding one by adding a fixed number 2. This sequence is call
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Tutorial 9 (Relations and Functions)
1.
In each of the following, find the value of set A X B:
(i) A = cfw_1, 2 , B = cfw_5, 6, 7
(ii) A = cfw_ Jack, Tom, Mar , B = cfw_ accountant, specialist
(iii) A = cfw_a, b, c, B = cfw_ x, y
2.
In each of the foll
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Topic 4: Permutation and Combination
In this topic, we will attempt to formulate some general principles to help us answer some of the
problems as below:
(a) In how many ways can 8 books be arranged in 4 empty spaces in a row on a bookshelf?
(b) In how ma
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Tutorial 5: (Set Theory)
1.
List the elements of the following sets , here N =cfw_1,2,3,4
(a) A = cfw_ x : x
(b) B = cfw_ x : x
(c) C = cfw_x : x
2.
N, 3 < x < 12
N , x is even, x < 15
N, 4 +x = 3
Consider the following sets:
, A = cfw_1, B=cfw_1,3, C=cfw
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Tutorial 6 : (Permutation and Combination)
1. Permutation
1.
In how many ways can 7 different posters be arranged in a row?
2.
Find the number of permutations of the letters of the word, OBJECT.
3.
If there are 10 airlines operating between Singapore and
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
use TSQL2012
go
create proc usp_getCustomer
@coName varchar(20),
@contName varchar(20)
as begin
select (companyname + contactname) as [Customer Name]
from sales.Customers
where companyname = @coName
and contactname = @contName;
end
exec usp_getCustomer @c
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Create the primary table
create table primaryTable
(
pid int NOT NULL PRIMARY KEY identity,
name varchar(10)
)
Create the secondary table (Note no relationship
between this and secondary table)
create table secondaryTable
(
sid int IDENTITY(1,1),
dummy
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Mathematical Function
select 2 + 3;
select 4 % 3;
String concatenation
select 'I am' + ' ' + 'Happy';
Example TOP function.
select TOP(5) contactname or select top(5) * it show row and columes
from sales.Customers
 ORDER BY
select * from sales.Custom
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
1) Sample on uniqueidentifier data type
 Step 1: Create a table with a uniqueidentifier data type
use testDB;
Go
CREATE TABLE dbo.TestGuid
(
id INT NOT NULL IDENTITY(1,1),
[Guid] UNIQUEIDENTIFIER NOT NULL guid is colume name
);
 Step 2: Add 3 rows usi
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Java Programming 2
Lecture 2
Introduction to Java Applets
21
Outline
What is an Applet
Applet methods
Drawing Shapes
Compiling and Executing Applets
22
Applets
A Java application is a standalone program with a
main method
A Java applet is a program tha
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Java Programming 2
Lecture 1
Introduction to OO Programming
and JOptionPane
11
Focus of the Course
ObjectOriented Software Development
objectoriented concepts
classes
objects
encapsulation
inheritance
polymorphism
Graphical User Interfaces
Exception
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Java Programming 2
Lecture 4
Inheritance
41
Outline
Inheritance
Superclasses and Subclasses
super Reference
protected Members
Composition vs. Inheritance
42
Inheritance
Fundamental objectoriented design technique used to
create and organize reusable clas
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Java Programming 2
Lecture 7
More on GUI
61
Outline
JCheckBox
JRadioButton
JComboBox
JList
Inner classes
62
Check Boxes
A check box is a button that can be toggled on or
off
It is represented by the JCheckBox class
Unlike a push button, which generates
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Java Programming 2
Lecture 10
Collections and
Data Structures
61
Outline
Collections
Abstract Data Types
Dynamic Data Structures
Linked Lists
Queues
Stacks
Trees
62
Collections
A collection is an object that serves as a
repository for other objects
A co
High Flyers School and Degree College Jutial Gilgit
DICT OOPG
PSB 00PG

Fall 2012
Java Programming 2
Lecture 3
Encapsulation
31
Outline
What is encapsulation
Packages
Formatting Output
Class Scope
Controlling Access to Members
Class Constructors
Overloaded Constructors
Accessor / Mutator Methods
Final Instance Variables
Composition
Usi