Course: Programming Concepts (3402) Semester: Spring, 2012
Level: BS (CS) Total Marks: 100
Pass Marks: 50

Note: All questions are compulsory. Each question carries equal marks.

Q. 1 Explain the difference between the following:
(a) Editor and the Compiler
(b) Source program and the object program

Q. 2 (a) How can you use pseudo code and flow charts to solve different problems related to programming? Explain.
(b) Explain the purpose and advantages of using comments in C/C++ Language.

Q. 3 (a) Write a simple program in C/C++ demonstrating the functions of relational operators.
(b) Differentiate between syntax errors and logical errors.

Q. 4 (a) Differentiate between Input and Output in C/C++ language. Which libraries and keywords and required for Input and Output in a C/C++ program?
(b) Write a simple program in C/C++ demonstrating the functions of assignment and logical operators.

Q. 5 (a) Write a program in C/C++ using nested if statement for calculating the average marks and grades of 5 subjects.
(b) Write a program in C/C++ using switch statement for calculating the average marks and grades of 5 subjects.

ASSIGNMENT No. 2
(Units: 5*–8)
Total Marks: 100 Pass Marks: 50

Q. 1 (a) Write a program that prints the squares of all the numbers from 1 to 20.
(b) What is the difference in execution sequence of the body of a do-while loop and a while loop? Explain with examples.

Q. 2 (a) What is the difference between break and continue statements? Explain with the help of suitable example.
(b) For what purpose functions are used? Explain the structure of functions with the help of an example.

Q. 3 (a) What is a return statement? What are its limitations?
(b) What are pre-processor directives? Explain the concept of header files.
(c) What are the main differences between functions and macros? Explain.

Q. 4 (a) How single dimensional, two-dimensional, and three-dimensional arrays are initialized? How these arrays can be passed as arguments? Explain by using an example.
(b) How sorting operation can be performed on arrays? Explain the sorting operation by using bubble sort.

Q. 5 (a) What is a pointer? Why are pointers used? What is an indirection operator?
(b) How pointer variables are defined? How values are supplied to pointer variables?
(c) Write a program using pointer notation to access individual elements of an array and print the sum and average of the elements of the array.


3402 Programming ConceptsCredit 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 Outlines:
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
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)




Sponsored Links