Get premium membership and access revision papers, questions with answers as well as video lessons.

Bms 201: Computer Programming November 2016 Question Paper

Bms 201: Computer Programming November 2016 

Course:Bachelor Of Commerce

Institution: Kenyatta University question papers

Exam Year:2016




FIRST SEMESTER EXAMINATION FOR THE DEGREE OF
BACHELOR OF COMMERCE

BMS 201: COMPUTER PROGRAMMING

DATE: November 2016 TIME: 2 HOURS

INSTRUCTIONS:

1. Question one is compulsory. Answer any other TWO questions.
2. Present your answers clearly by starting each question on a separate page.

Question One

a) Discuss any three compilers that can be used to write and execute C++ programs
(3 marks)
b) A university wishes to record and keep information of its students. The proposed student class has the following instance variables: Student No, Student Name, DoB, Course Name and CourseCode. Identify the data types for the mentioned variables.
(5 marks)
c) Any software application that is commercially available has a price tag and has to be purchased from the vendor. Discuss five costs associated with software.
(5 marks)
d) The sizeof operator can be used to determine the number of bytes occupied in memory by a variable of a certain type. E.g sizeof(short) is equivalent to 2 bytes. Write a C++ program that displays the memory space required by each fundamental type on screen.
(7 marks)
e) Using examples, discuss the evolution of computer programming languages.
(10 marks)



Question Two
a) You have been invited to give a talk to trainee programmers on the programming languages readability and writability. Summarize the points you would present in your talk.
(8 marks)
b) You are required to print and sum up all integers from – 1 to – 20.
i) Write an algorithm for arriving at a programming solution
(4 marks)
ii) Represent the algorithm using a flowchart
(4 marks)
iii) Write a C++ program to implement the flowchart design
(4 marks)



Question Three

a) Compare and contrast object oriented and procedure oriented programming paradigms.
(10 marks)
b) Consider the following class definition written by a novice programmer that represents a specific working day in a 12 week project period.

Public class DayAndWeek
{
Public int day;//day of the week, varies from 1- 5
Public int week; // week of the project, varies from 1 – 12
};

Provide a C++ code fragment showing a redesigned Day And Week class that more appropriately encapsulates the two instance variables.
(5 marks)
c) Generate the ANSI symbols used for design of flowcharts
(5 marks)


Question 4

a) Explain the role of #include < iostream > in a C++ program
(2 marks)
b) Discuss five guidelines to naming identifiers in C ++ programming.
(5 marks)
c) Discuss the iteration and selection program control structures giving the syntax of their implementation.
(5 marks)
d) Discuss programming language the attributes that lead to reliable programs.
(3 marks)
e) By using a suitable C++ program segment, show how you can initialize a 5 x 3 matrix from the keyboard.
(5 marks)






More Question Papers


Popular Exams



Return to Question Papers