Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

COMP1101C – Week 8

Revision Question

Lecturer: Ms. N. Laloo

Module: Computer Programming 1

University of Technology, Mauritius


Questions

2
Question

Write a MATLAB function that computes the average grade


based on a vector of test grades entered by the user. If the
student did not pass the class (that is, average grade <60)
then display the message “The student did not pass the
course”.

3
Question

Write a MATLAB function file that computes the average


grade based on a vector of test grades entered by the user.
If the student did not pass the class(that is, average grade
<60) then display the message “The student did not pass the
course”. If the exam grade is not <60 then display the
message “The student passed the course”.

4
Question

Write a MATLAB function file that computes the tip on a


restaurant bill. If the bill is less than Rs. 10 give a flat tip of
Rs.1.80. If the bill is greater than Rs. 10 but less than or equal
to Rs.60 give a 15% tip. If the bill is greater than Rs. 60 then
give 20% tip.

5
Question

6
Question

7
Question

8
Question

You might also like