0% found this document useful (0 votes)
66 views2 pages

EAR 105 Computer Programming I Main Exam

This document is an examination for a Computer Programming I course taken at Kenyatta University. It consists of 5 questions related to programming concepts and skills. Question 1 is compulsory and worth 30 marks, while students must attempt any 2 of the remaining questions worth 20 marks each. The questions cover topics like defining programming terms, designing programs to solve computational problems, explaining stages of the problem solving process, discussing data types, and writing functions. The final question involves writing a program to determine the optimal number of apartment units to rent to maximize profit based on rental rates and maintenance costs.

Uploaded by

sanicyril7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views2 pages

EAR 105 Computer Programming I Main Exam

This document is an examination for a Computer Programming I course taken at Kenyatta University. It consists of 5 questions related to programming concepts and skills. Question 1 is compulsory and worth 30 marks, while students must attempt any 2 of the remaining questions worth 20 marks each. The questions cover topics like defining programming terms, designing programs to solve computational problems, explaining stages of the problem solving process, discussing data types, and writing functions. The final question involves writing a program to determine the optimal number of apartment units to rent to maximize profit based on rental rates and maintenance costs.

Uploaded by

sanicyril7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

IST1010 INTRODUCTION

KENYATTA UNIVERSITY
UNIVERSITY EXAMINATIONS 2021/2022
FIRST YEAR, SECOND SEMESTER EXAMINATION FOR THE DEGREE OF BACHELOR OF SCIENCE
(AEROSPACE ENGINEERING)
EAR 105: COMPUTER PROGRAMMING I
MAIN EXAMINATION

DADATE: APRIL 2022 T TIME :2 HOURS


------------------------
------------------------------------------------------------------------
INSTRUCTIONS
This paper consists of FIVE questions
Question ONE is compulsory and contains 30 marks
Attempt any TWO of the remaining four questions. Each question is 20 marks
-----------------------------------------------------------------------------------
----------------------------

Question 1(30 Marks)

Define the following terms and give example for each


Programming language syntax
Logical error [4
marks]

Design a program to compute dew point value as represented in 1 C below [6 marks]

[8 marks]
Write a C++ program that computes and display volume of oil spherical containers of
radius between 2.5 metres and 6.7 metres. Program should display volume in litres .

[4 marks]

[8 marks]

Question 2(20 Marks).

Using a simple diagram illustrate structure of entry point loop. [3 marks]


Briefly explain stages of computer problem solving. State product of each stage.
[4 marks]
Design a program to compute a car drag force using formula in 2 d below

[6 marks]

[7 marks]

Question 3(20 Marks).

Discuss ant three user defined data types used in programming [6


marks]
Outline any three numerical data types
[3 marks]

[6 marks]
Write a driver function to make use of function in 3 C.
[5 marks]

Question 4(20 Marks).


Briefly explain how the following product are generated
Problem statement
Source code
Object code
Algorithm
[8 marks]
(b)
[4 marks]
(c) Samantha and Frankim are looking to buy a house in a new development. After
looking at various models, the three models they like are massionate, bungalow, and
SQ. The builder gave them the base price and the finished area in square feet of
the three models. They want to know the model(s) with the least price per square
foot. Write a program that accepts as input the base price and the finished area in
square feet of the three models.

The program outputs the model(s) with the least price per square foot [8 marks]

Question 5(20 Marks).

Outline main errors in programming . Give example of each. [6 marks]


Define the following items
Arrays
Structure
function implementation [6 marks]
A real estate office handles, say, 50 apartment units. When the rent is, say, kshs
60000 per month, all the units are occupied. However, for each, say, kshs 4000
increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an
average of kshs 2700 per month for maintenance. How many units should be rented to
maximize the profit? Write a program that prompts the user to enter:
The rent to occupy all the units. [2 marks]
The increase in rent that results in a vacant unit. [2 marks]
Amount to maintain a rented unit. [2 marks]
The program then outputs the number of units to be rented to maximize the profit.
[2 marks]

***************************END OFEXAMINATION**********************

You might also like