Pascal Programming and Applications (CSCT2205)
Computer Science - COS
Semester: Resit
Level: 200
Year: 2015
Page 1
SCHOOL: H.T.T.T.C DEPARTEMENT: CS LECTURER(S): Dr. DADA Jean-Pierre
COURSE CODE: CSC125 COURSE TITLE: Pascal programming language OPTION: FCS100
DATE: September, 2015 HALL: TIME: 1:30 NATURE: Resit
Instructions:…… NA…………..
Exercise 1: To calculate the volume of water that can contain the water tower, one suggests the formula:
, where V is the volume of water inside the water tower;
and
are respectively the radius of
circles, H is the height of the water tower.
In a village without any calculator, you can use your laptop to calculate the volume of the water tower.
1.1 Write an algorithm for this problem (3 marks).
1.2 Write an appropriate program using C language to solve this problem (3 marks).
1.3 Simulate your program and represent what you should have on the screen of your computer when the
program will be running (4 marks).
Instructions: The values of H,
and
are inserted when the program is running. You should also limit the
number to be used to display on the screen the results (two numbers after the dot). For simulations, use these
values: ; and H=2m. The program should take into account that the volume is a positive
number.
Exercise 3: Write a Pascal program able to calculate, the sum, the subtraction and the division of two real
numbers with the conditions below (6 marks)
1) The main program will just call three sub programs named SUM(…); DIVISION(…) and SUBTRACT(…).
2) all calculations are done in the sub programs
3) each sub program should return on result
4) The main program should enter from the screen the values of the two number and display on the screen, the
results
5) All necessary comments should be incorporated
REPUBLIC OF CAMEROON
Peace – Work – Fatherland
***********
THE UNIVERSITY OF BAMENDA
***********
HIGHER TECHNICAL TEACHER TRAINING
COLLEGE (H.T.T.T.C.) BAMBILI
***********
DIRECTORATE OF STUDIES
**********
P.O.BOX 39 BAMBILI
REPUBLIQUE DU CAMEROON
Paix – Travail - Patrie
***********
UNIVERSITE DE BAMENDA
***********
ECOLE NORMALE SUPERIEURE
D’ENSEIGNEMENT TECHNIQUE
***********
DIRECTION DES ETUDES
**********
Tél: 33 05 10 69
www.schoolfaqs.net