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

CSC 415 - EXERCISE

1. Draw a pseudocode that inputs two exam marks and then output both the smallest and
the largest of the two marks.

2. Four workers were responsible to pluck oranges. The owner of the orange farm will be
given 40% of the oranges. The workers share equally the balance of the oranges. The
balance of oranges after divided will be used to make juice. Draw a complete flowchart
and pseudocode that accepts input for the amount of oranges that were plucked. You
are also required to calculate and print amount of oranges that were received by the
owner, each of the workers and balance of oranges to make juice.

Sample output:
Enter number of oranges plucked : 100

Total oranges for the owner is 40

Total oranges for each worker is 15

Balance of oranges to make juice is 0

***********another output sample**************

Enter number of oranges plucked : 125

Total oranges for the owner is 50

Total oranges for each worker is 18

Balance of oranges to make juice is 3

3. At UiTM, students have to pay RM150 per credit hour taken for each semester. A
student must take at least 12 credit hours to be considered as full time and no students
may take more than 21 credit hours. Draw flow chart that input the student’s credit
hours taken for the semester and then output the student status whether full time or part
time student and the payment made by the student for the semester. Make sure to
display an error message if the credit hours entered is negative or greater than 21.
4. Draw flow chart and write a pseudocode that will determine the student’s grade based
on the average mark of a student. The program will read three marks between 0 and
100, calculate the average mark and display the grade received by the student and the
message based on the table given below. If the user enters number below than 0 and
above 100, error message will be displayed.

Average Mark Grade Message


0 – 49 F You fail the course. Try again next semester
50 – 64 C You pass the course, but more exercises needed.
65 – 74 B You pass the course. Good luck
75 – 100 A Congratulations, you have done a good job.

You might also like