0% found this document useful (0 votes)
6 views3 pages

IP Model Paper

The document outlines a model paper for an IT1010 final exam, consisting of four programming questions in C. The questions cover topics such as hotel room billing, smart meter readings, phone bill calculations, and employee salary increments. Each question includes specific requirements for input, processing, and output formatting, along with examples and expected functionalities.

Uploaded by

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

IP Model Paper

The document outlines a model paper for an IT1010 final exam, consisting of four programming questions in C. The questions cover topics such as hotel room billing, smart meter readings, phone bill calculations, and employee salary increments. Each question includes specific requirements for input, processing, and output formatting, along with examples and expected functionalities.

Uploaded by

Yellow Magic
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Introduction to Programming – IT1010

Final Exam – Model Paper

Question 1

The following table provides the details of the different types of rooms available in Blue Ocean
Hotel.

Room Type Description Rate per night


D Deluxe 31000.00
S Superior Deluxe 35000.00
C Club Suites 50000.00
E Executive Suites 75000.00
P Presidential Suite 100000.00

Write a C program that prompt the user to input the room type, number of rooms, number of nights
and paying method (cash - M or credit card -C) and display total amount payable to the hotel.

The customers are given 10% discount if they choose to make the payment by credit card.

Your program should display an error message “Invalid Room Type” and terminate, if the user
input a wrong room type, which is not listed in the table given above.

After displaying the total amount that need to be paid by the customer, the program should prompt
a message “Do you want to continue”. If the user inputs “y” or “Y” the program should ask the
user to enter the details of the next item. If the user input “n” or “N” the program should terminate.

Format your output to 2 decimal places.


Question 2

Smart meter reading is an electronic device that records consumption of electric energy in intervals
of an hour or less and communicates that information at least daily back to the utility system for
monitoring and billing.
Write a C program to store the daily electricity usage of a month (assume that one month has 28
days and exactly 4 weeks) and generate a summary report.

a) Use a two dimensional array to store the electricity usages. One row in the array should
store the usage of a week.

Following are the electricity usage of a house in Victoria in the month of November. Store
these data in the array.

1.2, 2.1, 0.8, 0.0, 1.0, 1.3, 4.0, 1.5, 3.2, 1.0, 1.3, 4.0, 1.5, 3.2, 2.3, 0.4, 1.2, 2.1, 0.8, 0.0, 2.6,
2.1, 1.7, 7.0, 1.2, 2.1, 0.8, 0.0

b) Generate the summary report as below based on the values stored in the array.

Day of the Month with maximum usage:


Maximum Usage in units:
Day of the Month with minimum usage:
Minimum Usage in units:
Average usage for the Month:
Total usage for the Month:

Question 3
Write a C program to store the details of phone bills.

a) In your program, enter the phone number, local call charges, international call charges and
roaming charges in to [Link].

Sample input

Phone no local call charges international call roaming charges


charges
0772123789 230.00 0.00 0.00
0777890345 1025.00 546.00 3278.00
0714289378 2345.00 135.00 0.00
0723481230 548.00 10.00 0.00
0776239487 2564.00 439.00 349.00

b) Write a program to read the details from the [Link] and print the total call charges for each
phone number. Print the phone number and total due amount for each phone number.
Question 4
Write a C program to calculate the employee salaries of a company. Employees are entitled to get
an increment according to their grades. Increment percentages for each grade is given in the
following table.

grade Increment
1 10%
2 15%
3 20%

Write a function called calculateIncrement() to calculate and return the increment given for
the employees. Function prototype is given below.
float calculateIncrement(int grade, float basicSalary);

Write a function called calcTotSalary() to calculate the total salary.


(total salary = salary + increment ).

float calcTotSalary(float salary, float increment);

In your main function enter the basic salary of an employee and the grade from the keyboard.
Display the increment and total salary as follows using the functions created above.

Enter Salary : ………….


Enter grade: ……….
Increment: ………….
Total Salary :…………………

You might also like