Tuesday 29 November 2011

Designing programs with flowchart (2)

You are required to design a flowchart for all programs below:-

Question 1
Design a flowchart for a program that accepts integer arguments and determines whether the passing integer is odd or even. (if-else)

Question 2 
Design a flowchart for a program that print the multiplication table for any number. (for loop)
eg:
What number? 2
2 x 1 = 2
2 x 2 = 4
2 x 3 = 6
2 x 4 = 8
2 x 5 = 10
2 x 6 = 12
2 x 7 = 14
2 x 8 = 16
2 x 9 = 18
2 x 10 = 20
2 x 11 = 22
2 x 12 = 24

Question 3
You are required to design a flowchart for a program to calculate your utility bill. The payment is based on the following table: (nested if-else)


The numbers of units are calculated based on the current meter reading and the previous meter reading. The bill also includes a fixed charge, which is RM35.00.

Example:
If the previous reading is 2300 and the current reading is 2800, then the payment is RM161.00.
Output: 


P/S: Your flowchart should be handwritten, 1 page for each question.
Deadline: 2nd December 2011,  before 12pm

No comments:

Post a Comment