Allama Iqbal Open University, Islamabad (Department of Computer Science) Warning
Allama Iqbal Open University, Islamabad (Department of Computer Science) Warning
WARNING
1. PLAGIARISM OR HIRING OF GHOST WRITER(S) FOR SOLVING
THE ASSIGNMENT(S) WILL DEBAR THE STUDENT FROM AWARD
OF DEGREE/CERTIFICATE, IF FOUND AT ANY STAGE.
2. SUBMITTING ASSIGNMENTS BORROWED OR STOLEN FROM
OTHER(S) AS ONE’S OWN WILL BE PENALIZED AS DEFINED IN
“AIOU PLAGIARISM POLICY”.
ASSIGNMENT No. 1
Course: Programming Concepts (3402) Semester: Spring, 2010
Level: Graduate Total Marks: 100
Pass Marks: 40
Q.1 (a) What is a programming language? Why do we need to use it? What are the
characteristics of fourth generation programming languages (4GLs)?
(b) What characteristics of C language make it preferable to be chosen for
programming? What is the difference between source program and object
program? (20)
Q. 2 (a) Why translators are used to translate the computer programming languages?
Differentiate between compiler and interpreter.
(b) Discuss different techniques to solve a problem. Why pseudo code or flow
chart is necessary before writing code in any programming language? (20)
Q. 4 (a) Differentiate between a constant and a variable. How constants and variables
are declared in C and C++? Describe the data types used in C and C++.
(b) Differentiate between operators and operands. Describe the operators used in
C and C++ to solve different arithmetical and logical expressions. (20)
1
ASSIGNMENT No. 2
Total Marks: 100
Pass Marks: 40
Q.1 (a) What is the role of selection and counter structures in programming? Explain
in detail.
(b) Use selection structure to implement the program for which your developed
the pseudo code in assignment number 1, question number 5. (20)
Q. 2 (a) Differentiate between if/else structure and switch structure in C and C++.
Why switch statement is more efficient than using multiple if/else
statements?
(b) Write a program in C or C++ to perform different arithmetic operations using
switch statement. The program should accept two integers and an arithmetic
operator as input from the user to perform the specific operation on the given
integers. (20)
Q. 3 (a) What is the role of functions in a programming language, how do they make
a program modular?
(b) What is difference between function parameter passing by value and by
reference?
(c) Write C or C++ function to calculate the factorial of a positive integer given
by the user as an input. (20)
Q. 4 (a) What do you mean by two dimensional and multidimensional arrays? Please
explain.
(b) Write a program in C language to keep the record of 20 students by using
array. The program should have capability to search the student and display
the result if search is successful. (20)
Q. 5 (a) Why pointers are used in C/C++? Describe the advantages and disadvantages
of using pointers.
(b) Write a sample program that demonstrates the concept of pointer to
pointers. (20)
2
3402 Programming Concepts Credit Hours: 4 (3,1)
Recommended Book: The Wait Group's Turbo C Programming for the PC and Turbo
C++ by Robert Lafore
Objectives: This course primarily aims at developing key elementary concepts in
computer programming. The objectives of the course are to explain (Foundation of
computer programming, elements of computer programming, development of structured
computer programs, learning of programming language C to implement structured
computer programming)
Course Outline:
Unit No. l: Introduction to Computer Program
Computer Program concepts, High Level Languages, 4GL, Editor, Compiler,
Source Program, Object Program
Activities: The students shall be demonstrated various high level languages, 4GL,
editors, compilers, source programs, and object programs
3
Activities: The students shall be given daily life problems and use computer
laboratory to demonstrate (Simple function program, Function with value return,
Function with arguments, Recursion)
=======