KEMBAR78
Statements To Pseudocode or Flowchart | PDF
0% found this document useful (0 votes)
33 views4 pages

Statements To Pseudocode or Flowchart

Uploaded by

dan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views4 pages

Statements To Pseudocode or Flowchart

Uploaded by

dan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1. (a) Draw a program flowchart that would accept and their sum.

If the
sum is greater than 200, it adds 30 to the sum, otherwise subtracts 20
from the sum. The program should then display the results
(7 marks)

2. A trader bough a car from a manufacturer and later sold it to another person. Write a
pseudocode for a program that will accept the buying price and the selling price of the
car, determine whether the trader made a profit/or loss, calculate the profit/loss and
display it. [4 marks]
START
ENTERR “Buying Price) (Bp), Selling price (Sp)”
IF “Bp, Sp THEN
Profit = Sp-Bp
PRINT Profit
Else
Loss=Bp-Sp
PRINT Loss
Endif
STOP
(e).Draw a flowchart for the above pseudocode.
(4 marks)
3. Write an algorithm using both pseudocode and flow chart to print the sum and average of
numbers from 1 to n where n is provided by user and n>=1.
[10]

Start
Sum=0, k=1
Read n
If n>=1 then
Repeat
Sum=Sum + k
k=k+1
Until k=n
Average=Sum/n
Print Sum, Average
Stop
4. A bookshop owner contracted a programmer to design a program that can be used to
manage n number of books in his business as follows;
 Enter the book name, publisher and marked price of each book.
 Calculate the discount and new price of each book.
The book shop gives a discount of 13% for purchase of a books worth Ksh.5, 000, 8% for
purchase of books worth Ksh.1000 and none for purchase worth Ksh.1,000 and below.
Draw a flowchart to represent the information above, count number of books and output book
name, publisher, marked price, discount and new price. (7 marks)

You might also like