0% found this document useful (0 votes)
14 views

Course Plan (COMP 103)

Uploaded by

mjenish99
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Course Plan (COMP 103)

Uploaded by

mjenish99
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Department of Computer Science and Engineering

School of Engineering | Kathmandu University

COMP 103: STRUCTURED PROGRAMMING [2 Credit]


First Year, First Semester ,Course Plan : 2015 (Fall)
Instructor: Satyendra Nath Lohani
Course Description:
This course introduces the fundamental concepts of procedural programming in C. Topics include
data types, control structures, functions, arrays, etc. This course also focuses on the development of
problem solving skills using programs.

Course Objectives:
This course is an introductory course to structured procedural programming concepts. In this course
you will learn how to program basically using C programming Language. Topics include Fundamentals
to Programming, Data Type, Looping Array, Pointers, and Structures etc.

Prerequisite:

None. Familiarity with basic computer skills will be helpful.

Grading Policy:

Final Exam: 50 %

First Internal: 10% (1 hour)

Second Internal: 10% (1 hour)

Quiz: 5%

Internals: Assignments: 5%

Lab Report: 5%

Viva Voice 5%

Final Lab Exam 10%


1. Theory and Problems of Programming with C, 2/e by Byron S. Gottfried.
Text Books:
Course Syllabus
Problem Solving Using Computers [2 hrs]

 Problem Analysis
 SDLC(Software Development Life Cycle)
 Algorithm Development & Flowcharting
 Coding
 Compilation & Execution
 Debugging & Testing

Introduction to C [ 2 hrs ]

 Historical Development of C
 Importance of C
 Basic Structure of C Programs
 Executing a C Program

Fundamentals of C [4 hours]

 The C Character Set


 Identifiers and Keywords
 Data Types
 Variables, Constants, Declarations Statements

Operators and Expressions [5 hours]

 Introduction
 Arithmetic Operators
 Unary Operators
 Relational and Logical Operators
 Assignment Operators
 Conditional Operators
 Operator Precedence

Decision Control Statements [5 hours]

 Introduction
 The if-else Construct
 The nested if-else Construct
 The else-if ladder Construct
 The switch Construct
Loop Control Statements [5 hours]

 Introduction
 The while Construct
 The do-while Construct
 The for Construct

Functions [6 hours]

 Anatomy of a Function (Defining a function, accessing a function)


 Function Prototype
 Recursion (Introduction and some programs)

Program Structure [1 hour]

 Storage Classes
 Automatic, External and Static Variables

Arrays [5 hours]

 Introduction
 Processing an Array
 Passing Arrays to Functions
 Multidimensional Array

Structures [5 hours]

 Understanding C's Structures


 Referencing a Structure Member
 Using Structure with Function calls
 Arrays of Structures
 Understanding Unions

Pointers [3 hours]

 Introduction
 Passing Pointers to Functions
 Pointers and One Dimensional Array
 Pointers to Structures
 Dynamic Memory Allocation
 Operations on Pointers

Total Lecture Hours: 75 (15 Weeks * 5 hours of theory and Practical)


Laboratories: There shall be 12 lab exercises covering features of C programming.
Assignment: There shall be 4 assignments which cover the detail concept of Structured
Programming Language and Late Assignment is not acceptable.

Plagiarism, cheating, and other forms of academic dishonesty will not be tolerated, this may
affect the grading.

…………………………………………………………………………………………………………………………………………..

Programming Set #1: Introduction

1. A Sample C program.
2. Some Programming related formatted strings.

Programming Set #2: Operators and expressions

1. Write a program to convert centigrade to Fahrenheit. [F = 9/5 * C + 32]


2. Write a program that calculates the area of a circle and circumference.
3. Write a program that calculates the area of a triangle.
4. Write a program that reads the marks in each subject and calculates the percentage.

Programming Set #3: Conditional Statements

1. Write a program that reads a number and identifies whether the given number is even or
odd.
2. Write a program to find the largest number among two numbers
3. Write a program to read the mark of a subject and prints the equivalent grade.

Programming Set #4: Loop

1. Write a program to read a sentence and counts the total number of character (excluding
space) using while loop.
2. Write a program to generate Fibonacci number using do while loop.
3. Write a program to read number and identifies whether the given number is a prime
number or not.
4. (Try this at HOME) Write a program to identify whether the given number is a perfect
number or not. 28 is a perfect number.
5. (Try this at HOME) Write a program to calculate the factorial of a given number.
Programming Set #5: Function

1. Write a program to identify whether the given number is a perfect number or not using a
function. 28 is a perfect number.
2. Write a program to evaluate GCD of two given integers. Use function that returns GCD.

Programming Set #6: Recursion

1. Write a recursive program to find the factorial of a given number.


2. Write a recursive program to find a GCD of two numbers.
3. Write a recursive program to find the sum of n natural numbers.

Programming Set #7: Array

1. Write a C program to store N numbers in a one dimensional array and calculate its
average with the help of the function.
2. Write a C program to convert a binary number to decimal with the help of the function int
todecimal(int bits[20], int length) where bits is the character array to represent bits of
binary numbers and length is the number of bits in the binary number.

Programming Set #8: Array

1. Write a program to evaluate transpose of n by n matrix with the help of function void
transpose(int matrix[][20], int n) where matrix is the matrix to be transformed and n is the
dimension of matrix.
2. Write a C program for matrix addition with the help of function add(int a[][20], int b[]
[20], int n, int m) where a and b are matrix to be added and n and m are dimension of a
and b.
3. Write a C program to determine determinant of a square matrix with the help of function
int determinant(int a[][], n) where a is the matrix whose determinant is to be found and n
is dimension of square matrix.

Programming Set #9: Sorting

1. Write a program to arrange the numbers (array) in ascending order using bubble sort.

Programming Set #10: Structure

1. Write a program that defines a structure called STUDENT with suitable attributes and
reads the data for 5 students. Your program should display the records in ascending order
according to the name of the students.
2. Consider a plane graph. Write a program that uses function to return a distance between
given point and the origin.

Programming Set #11: Pointers


1. Write a program that swaps two variables. Use function and pointers.
2. Solve the matrix multiplication Programming using pointers.

Assignment Set #1

Question 1: What is meant by operator precedence? Illustrate with an example.


Question 2: What is meant by associativity? Illustrate with an example.
Question 3: What are library functions? Why are they important?

Assignment Set #2

Question 1: Compare the use of the if-else statement with the use of conditional operator.
Question 2: What is the purpose of the default keyword?
Question 3: What is the purpose of do-while statement? How does it differ from the while
statement?
Question 4: What is the purpose of the break statement?

Assignment Set #3

Question 1: We use functions to make our programs modular. State at least three advantages of
making your program modular.
Question 2: What is Recursion? What advantages is there in its use?
Question 3: What three types of errors do function-prototypes help prevent?
Question 4: What is meant by the scope of a variable within a program?

Assignment Set #4

Question 1: In what way does an array differ from an ordinary variable?


Question 2: Differentiate between pass by value and pass by reference with an example.
Question 3: What is a pointer variable? What are the advantages of using a pointer?
Question 4: What is the difference between array and pointer variable? In what way are they
similar?
Question 5: What is a structure? How is it different from union?

You might also like