IT1010 Introduction To Programming Mid Semester Examination (20 Marks)
IT1010 Introduction To Programming Mid Semester Examination (20 Marks)
1. Select one real world problem or operation that can be solved using your knowledge
gained in the introduction to programming module. The problem should have
a. Repetition
b. Selection – with minimum of 3 choices
c. Calculation
Describe the problem using your own words.
2. Write a solution for the above problem using C.
3. Write test cases (minimum of two) for your program covering all possible situations
that can happen.
4. Show your program output for the above test cases.
5. You should not copy from others. All assignments will be uploaded to Turnitin
plagiarism detection tool. Similarity score greater than 30% will bring you 0 marks.
6. Please refrain from copying from internet or from books either, since there is a danger
that two students copy from same source, and will end up with 0 marks.
7. You have to prepare one word document file (your_studnet_id.docx) with answers
for all the sections from 1 - 4.
8. Submit the word document file (your_studnet_id.docx) and pdf version of the same
document (your_studnet_id.pdf) as zip folder to the relevant course web link.
9. Submission deadline is 9th of April 2020, on or before 5.00 p.m.
Sample answer
ABC higher education institute offers three courses in this academic year. The courses and
their registration fees are given in the following table.
Only 10 students will be registered for all three courses within one academic year. The
registration for all three courses will be held on the same day first come first serve basis.
Write a C program to register students for the above courses by entering their course type
from the keyboard. The program should accept both uppercase and lowercase letters as
correct inputs for course type. Your program should display the number of students
registered for each course and the total registration fee earned from each course. When the
course type is invalid, the program should display an error message.
The program should terminate the registration when the total number of registrations
becomes 10 or there are no more registration to be done.
#include <stdio.h>
int main(void)
{
char type, ch = 'Y';
int sCount = 0, countH = 0, countM = 0, countF = 0;
Marking Guide
Part 1
Complexity of the problem
Repetition 3.0 marks
Selection 3.0 marks
Calculation 2.0 marks
Clarity of writing 2.0 marks
Part 2
Correct use of repetition in C 2.0 marks
Correct use of selection in C 1.5 marks
Correct use of calculation in C 1.5 marks
Coding convention 1.0 mark
Part 3
Correct test case 1.0 mark
Part 4
Correct program output 1.0 mark
Part 5
Additional features (display menus , warning messages , nice 2.0 marks
output formats)
Total 20.0 marks