You are on page 1of 2

3.

Write the analysis, pseudo code, draw the flowchart and develop a complete program

where it calculates the amount to pay for two books which the price for the book is
RM25.50.

The discount given for the books is 5%. Example of the output is:

Price for a book: RM25.50

Quantity: 2

Price before discount: RM51.00

Price after discount: RM48.45

After that, compile and execute the program. (20 marks)

Analysis
Objective:to calculate the amount to pay for two books
Input: price,quantity
Process: totalprice = price * quantity
Discountprice: totalprice*0.95
Output:

Pseudocode
1. start
2. input height & base
3. calculate area = height * base * 0.5
4. print area
5. end

Flowchart

start

Height,base

Area=0.5 * height * base

area

end

You might also like