You are on page 1of 4

ALLAMA IQBAL OPEN UNIVERSITY, ISLAMABAD

(Department of Computer Science)

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

All questions carry equal marks.

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. 3 (a) Which types of variables are used in C?


(b) What is the use of escape sequence in C? Which escape sequences are used
and what are their purposes? (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)

Q. 5 (a) What are different types of errors in C?


(b) Write pseudo code along with flowchart of calculation of electricity bill
according to current slab rates of WAPDA. (20)

1
ASSIGNMENT No. 2
Total Marks: 100
Pass Marks: 40

All questions carry equal marks.

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

Unit No. 2 Computer Program Engineering


Introduction, Problem Solving Techniques (pseudo code, flowchart), Qualities of
Good Program, Program Life Cycle
Activities: The students shall be given simple daily life problems for developing
pseudo code and program flowcharts

Unit No. 3 C Building Block


Constant, Variable, Data Types, Operators, Expression, C Program Structure, Input
and" Output, Debugging Procedures, Errors (Logical, Syntax)
Activities: The students shall be given simple daily life problems and use computer
laboratory to demonstrate (Constant, Variable, Expression building, Developing
simple C programs, Compiling, running, and debugging C programs)

Unit No. 4 Decision Making


Simple Decision (if, if/else), Complex Decision (Switch Structure, Nested
Decisions)
Activities: The students shall be given daily life problems and use computer
laboratory to demonstrate (if, if/else, Nested Decisions, Switch Structure)

Unit No. 5 Loops


For, while, do/while
Activities: The students shall be given daily life problems and use computer
laboratory to demonstrate (for, while, do/while)

Unit No. 6 Functions


Function concept, A Simple function program, Function with value return,
Function with arguments, Recursion

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)

Unit No. 7 Arrays & Strings


Introduction, Single and Multidimensional, Organizing Array Elements, Strings
Introduction, String Constant, String Variable, String I/O functions (gets() and
puts()), An array of String Activities: The students shall be given daily life
problems and use computer laboratory to demonstrate (Single and
Multidimensional, Organizing Array Elements, String Constant, String Variable,
String I/O functions (gets() and puts() ), An array of String

Unit No. 8 Pointers


Overview, Pointer Types, Pointers & arrays, Double indirection
Activities: The students shall be given daily life problems and use computer
laboratory to demonstrate (Pointer implementation, Pointers & arrays
implementation, Double indirection)

Unit No. 9 Structures


Introduction, Declaring a structure, Accessing structure elements, Entering data
into structures, Initializing structures, Array of structures
Activities: The students shall be given daily life problems and use computer
laboratory to demonstrate (Structure implementation, Accessing structure elements,
Entering data into structures, Initializing structures, Using an array of structures)

=======

You might also like