0% found this document useful (0 votes)
0 views

ICT1402 Tutorial 11

The document outlines a tutorial activity for ICT 1402 at Rajarata University, focusing on principles of program design and programming. It includes tasks such as finding minimum and maximum values in an array, calculating totals and averages, managing student marks, and developing a cashier system. Additionally, it covers electricity billing calculations and payroll processing for employees.

Uploaded by

iammsign
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

ICT1402 Tutorial 11

The document outlines a tutorial activity for ICT 1402 at Rajarata University, focusing on principles of program design and programming. It includes tasks such as finding minimum and maximum values in an array, calculating totals and averages, managing student marks, and developing a cashier system. Additionally, it covers electricity billing calculations and payroll processing for employees.

Uploaded by

iammsign
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Rajarata University of Sri Lanka

Department of Computing

ICT 1402 - Principles of Program Design and Programming


Tutorial 11 / Portfolio Activity

1. Type in and run all programs presented in lecture note 11. Briefly describe the theory/
concept you learned from these programs separately.

2. Find the minimum and maximum of sequence of 10 numbers stored in array.

3. Find the total and average of a sequence of 10 numbers stored in array.

4. Following list represents the data units used by three persons. Create an array to store
these details and print the list.
person work mobile home
1 500 1000 300
2 10 1800 200
3 200 400 700

Find the following using the above table;


I. Find the total unit consumed.
II. Find the total consumption of units for each phone type.
III. Who consumed maximum unites for mobile phones?
IV. Who pays highest phone bill?
V. Who pays lower phone bill?
VI. How many units are consumed by person 3?

5. Write a program to store students’ marks for COM1407 subject. Assume there are 10
students in the class. You have to store marks in a 2D array as shown below.

Mid term Portfolio End semester Final Marks Total Rounded


examination (10%) examination (70%) Marks
(mid term
(20%) (100%)
examination
+portfolio
+final marks

Note: Use keyboard input appropriately.

1
Find the following using the above entered marks;
I. Display detailed mark sheet
II. Find the highest marks for midterm examination, portfolio work and end semester
examination separately
III. Find the student count based on the following criteria
a. Rounded Marks >= 90% : Grade A
b. Rounded Marks >= 80% : Grade B
c. Rounded Marks >= 70% : Grade C
d. Rounded Marks >= 60% : Grade D
e. Rounded Marks >= 40% : Grade E
f. Rounded Marks < 40% : Grade F
Your output should be displayed as follows
Grade Count
A 
B 
C 
D 
E 

6. Assume a village has 20 houses. Input electricity unit charges and calculate total
electricity bill according to the following criteria:
 For first 50 units Rs. 0.50/unit
 For next 100 units Rs. 0.75/unit
 For next 100 units Rs. 1.20/unit
 For unit above 250 Rs. 1.50/unit
An additional surcharge of 20% is added to the bill
I. Write a program to store house address, units consumed, surcharge and total
amount separately in arrays.
II. Display the detailed monthly consumption report of the village using the
following order

Serial Number: House Address Units Surcharge Amount to be paid

III. Calculate the total earnings of the month


IV. Calculate the total units consumed

2
7. Extend the following program that you did in Tutorial 05 to store the processed bills in a
buffer.
Develop a program to a cashier system for a shop.
Your system should display following prompt for the cashier and the entire program is
controlled according to the command given by the cashier.

Welcome to <shop name>

Press S  Start

Press Q  Quit

Press P  Process Bill

Your option : _

Once you press S: System will display welcome message and ready for processing a bill
by initializing required variables.

Once you press Q: You can shut down the cashier system.

Once you press P: Process the current customer’s shopping cart. Here, you can enter the
item code, qty, unit price of the items in shopping cart and calculate and display the total

Once you finished serving to the current customer, you can press N to move to the
prompt.

8. Design a program for payroll department to calculate the monthly payment of 10


employees. Use arrays appropriately. Finally you need to display 10 pay sheets one after
the other.

You might also like