Professional Documents
Culture Documents
Those who are working in pairs should select any TWO questions.
Those who are working in a group of three should select any THREE questions.
Question 1
The National Earthquake Information has asked you to write a program implementing the
following decision table to characterise an earthquake based on its Richter scale number.
Your program should display a meaningful output message and/or invalid message for each
input and should continue until user decides to terminate the program. You can add more
characterisation details for each Richter scale.
Question 2
Write a program that will calculate and print bills for the City Power company. The rates
vary depending on whether the use is residential, commercial, or industrial. The rates
computed as follows:
Residential $6.00 plus $0.052 per kwh used
$60.00 for the first 1000kwh and $0.045 for each additional
Commercial kwh
Rate varies depending on time of usage:
Peak hours : $76.00 for the first 1000 kwh and $0.065 for
Industrial each additional kwh.
Off peak hours : $40.00 for first 1000kwh and $0.028 for
each additional kwh
Your program should prompt the user to enter an account number, the code (either
residential, commercial or industrial) and the necessary consumption figures in whole
numbers of kilowatt-hours. Your program should continue until users decide to quit and
should display Invalid data entry messages.
Page 1
Question 3
Write a program to process a collection of daily high temperatures. Your program should
count and print the number of hot days, the number of pleasant days and the number of
cold days. It should also display the category of each temperature. You should design the
category and the range of temperatures for each category. Print invalid data entry message
and prompt user to enter the valid input again.
Question 4
Write a program to model a simple calculator. You program should accept a pair of integers
(operands) and operators [addition / subtraction / multiplication / division and power (^)].
Design the output to display the entered values and the result of the arithmetic operations.
Your program should continue until users decide to quit and should display invalid data
entry messages.
Requirements
Submission of Work
The Question Number(s) should be the name of the C program(s).
Save all the C program source codes in a CD.
Print IPO chart, Test Data and assumption made for each question.
Place the CD in a proper plastic CD cover and label it with the necessary details
[Name, Student ID, Programme and Group ]
Print and fill in the Course submission and Assessment Criteria Forms [U:\All
Users\Foundation\Reginamary Matthews]
Deposit your CD and Assessment Criteria Form (** labelled CD plastic cover) in an
envelope.
Seal the Coursework Submission Form on the envelope.
Submit your ENVELOPE to the Faculty of Science Office before the due date.
Page 2