Acmp 226: Program Design Question Paper
Acmp 226: Program Design
Course:Bachelor Of Science In Applied Computer Science
Institution: Chuka University question papers
Exam Year:2013
CHUKA
UNIVERSITY
UNIVERSITY EXAMINATIONS
EXAMINATION FOR THE AWARD OF DEGREE OF BACHELOR OF SCIENCE IN APPLIED COMPUTER SCIENCE
ACMP 226: PROGRAM DESIGN
STREAM: BSC. (APPLIED COMP. SCIENCE TIME: 2 HOURS
DAY/DATE: FRIDAY 9/8/2013 8.30 A.M. – 10.30 A.M.
INSTRUCTIONS:
1. Answer question ONE and any other TWO questions
2. Marks are awarded for clear and concise answers
Question 1 (30 marks)
a) Why is main function special in C++? [2 marks]
b) Highlight the differences between compiler and interpreter languages. [4 marks]
c) Demonstrate and explain the basic constructs of a c++ program [5 marks]
d) Giving examples discuss the scope of variables in programming [5 marks]
e) In how many different ways can a c++ variable initialization be done? Explain and give examples? [4 marks]
f) Identify and discuss the three loop control statements in C++ [3 marks]
g) Giving examples, differentiate between run-time, logical and syntax errors in programming [6 marks]
h) Object oriented programming languages introduce the aspect of class and objects. Using an example define a C++ class that defines the variables length, breadth and width that are necessary to determine the surface area of a box [1 mark]
Question 2 [20 Marks]
a) Why is it necessary to use a function in a program? [3 marks]
b) Identify and explain the general structure of a C++ function [10 marks]
c) To enhance security, some applications will require a user to type then retype a password during login registration. Write a C++ program that checks the similarity of the two keyed in passwords then alerts the user on the similarity or dissimilarity of the passwords. [7 marks]
Question 3 [20 Marks]
a) Describe an array and its use within a program [5 marks]
b) Write a C++ program that utilizes arrays in the coding [5 marks]
c) Write a C++ function to determine the grade of a student in course unit ACMP 226 given the following:
Marks in Unit Grade
80-100 A
60-79 B
40-59 C
0-39 D
Also demonstrate how to call the function within a C++ main program [10 marks]
Question 4 [20 Marks]
a) Differentiate between while, do…while and for loops [3 marks]
b) Using a C++ sample program, discuss the concepts of infinite loops in programming. [7 marks]
c) Demonstrate through a C++ program a pointer in a program and discuss their importance in programming in general [10 marks]
Question 5 (20 Marks)
a) Discuss the standard error and the standard log streams in C++ [5 marks]
b) You are developing a library management system and are given the following attributes touching on the books; Title, Author, Subject and Book ID. Use the data given to develop a C++ structure to use within the program. Why are structures necessary in a program? [10 marks]
c) Develop a class shape and object rectangle which is an instance of the class. The area of a rectangle is calculated using the length and the width. [5 marks]
________________________________________________________________________
More Question Papers
Exams With Marking Schemes