Вы находитесь на странице: 1из 5

Final: 27-3-2019

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 ASSIGNMENT(S) BORROWED OR STOLEN FROM
OTHER(S) AS ONE’S OWN WILL BE PENALIZED AS DEFINED IN
“AIOU PLAGIARISM POLICY”.

ASSIGNMENT No. 1
Course: Programming in C/C++ Language (3577) Semester: Spring, 2019
Level: PGD (CS) Total Marks: 100

Note: All questions are compulsory and carry equal marks.

Q. 1 a) Why there is a need to write a program for the computer? Is it (20)


necessary to write an algorithm before writing a program?
b) The computer program goes through different phases during its life cycle.
Discuss the various stages of program life cycle with examples.

Q. 2 a) How an Integrated Development Environment (IDE) helps a (20)


programmer to edit, compile and run a program? Discuss the features
of the IDE you are using for program development in this course.
b) Write the steps to make a cup of tea using pseudo-code and flow-
chart.
Q. 3 a) Discuss the difference between a good and a bad program with (20)
examples.
b) Write an algorithm in English language and then a program in C/C++
to calculate the average of 10 integers entered by user of the program.

Q. 4 a) Write down a program in C/C++ to greet the user by asking his/her (20)
name and elaborate the basic components of the program.
b) What type of errors can occur while writing a computer program?
Differentiate between syntax and semantics errors. How these errors
can be removed or corrected?

Q. 5 a) Define a Prime number and write a program in C/C++ to determine (20)


that a number is Prime or not by getting the input from a user.
b) Write a program in C/C++ to display the grades of a student using
switch statement.
ASSIGNMENT No. 2
Total Marks: 100

Note: All questions are compulsory and carry equal marks.


Q. 1 a) Write a program in C/C++ to demonstrate the difference (20)
between if/else and switch statements.
b) Write a program in C/C++ to demonstrate the difference
between while and do/while loops.

Q. 2 a) Write a program in C/C++ using for loop to display the table of (20)
a number given by the user.
b) Why functions are used in C/C++? Write a program in C/C++ to
demonstrate the use of functions.

Q. 3 a) Lists are used to store a number of similar items in a single data (20)
structure. Get 10 integers as input from the user and sort the list
in an array.
b) Discuss the difference between character array and integer array
in C/C++ with the help of a program.

Q. 4 a) Demonstrate the usage of character array and string functions in (20)


C/C++ with programming examples.
b) Get the name of a user and say hello to him/her using character
array and string functions.

Q. 5 a) Discuss the advantages and disadvantages of using pointers in (20)


programming. Write a program to elaborate the concept of
pointers.
b) Write a program to demonstrate the concept of pointer to a
pointer.

2
ALLAMAIQBALOPEN UNIVERSITY, ISLAMABAD
(Department of Computer Science)
3577 Programming in C/C++ Language
Course Code: 3577
Course Title: Programming in C/C++ Language
Credit Hours: 4 (3 + 1)
Session Offered: As per offering schedule
Recommended Book: C How to Program, Paul Deitel and Harvey Deitel,
Prentice Hall; 7th Edition (2012)
A/V/ Multimedia Content: As defined by the Instructor / MOOCs links
Reference Book: Programing in C, Stephen G. Kochan, Addisson-Wesley
Professional; 4th Edition (2013)
Pre-Requisite: None
Course Coordinator: Dr. M. Arshad Awan
Teaching Methodology: Online/Workshop
Computer Usage: Programming practice is required

Course Introduction:
This course primarily aims at developing key elementary concepts in computer
programming. The course is designed 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 Objectives:
After completing the course, the students should be able to:
1. Develop problem-solving skills to translate 'English' described problems into
programs written using the C language.
2. Write C programs which are significant in scope and complexity.
3. Understand all phases of the programming process form design through
implementation utilizing C.
4. Have a working knowledge of the C programming environment, including the use
of the interactive debugger.

Evaluation Criteria:
i. Assignments (02) 10%
ii. Mid Term Theory/Practical Examination 20%
iii. Final Examination 70%

3
Course Outline:
Unit# 1: Introduction to Computer Program
Computer Program, Types of Languages (Low Level & High Level), Editor,
Translator (Compiler & Interpreter), IDE, Source Program, Object Program

Unit# 2: Computer Program Engineering


Algorithm, Problem Solving Tools & Techniques (Pseudo Code, Flowchart),
Qualities of a Good Program, Program Life Cycle

Unit# 3: C Building Block


Constant, Variable, Data Types, Operators, Expression, C Program Structure,
Input and Output, Debugging Procedures, Errors (Syntax & Logical)

Unit# 4: Decision Structures


Single, Double & Multiple Selection Structures (if, if/else & case Structures),
Conditional Operator, Nested Decisions

Unit# 5: Loops
Counter Loops (for), Conditional Loops (while, do/while)

Unit# 6: Functions
Function (Introduction, Definition, Declaration & Prototype), Function with
value return, Function with arguments, Recursion

Unit# 7: Arrays & Strings


Arrays Introduction, Single and Multidimensional Arrays, Organizing Array
Elements, Strings Introduction, String Constant, String Variable, String I/O
Functions (gets() and puts()), Array of Strings

Unit# 8: Pointers
Pointers Overview, Pointer Types, Pointers & Arrays, Double Indirection

Unit# 9: Structures
Structures Introduction, Declaring a Structure, Accessing Structure Elements,
Entering Data into Structures, Initializing Structures, Array of Structures
Activities / Practical:
1. Steering of Integrated Development Environment
2. Program creation in the IDE.
3. Device a simple C program.
4. Program: mathematic operations with logical and relational operators and
looping
5. Program: function, recursion, arrays and strings, file handling.
6. Program: reading existing files.

Note: instructor can assign programming project to a group or individual student.




4
AIOU–AS-154(19)/PPU–27-3-2019–100.

Вам также может понравиться