0% found this document useful (0 votes)
5 views

A pseudocode and flowchart-Question (1)

Python
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

A pseudocode and flowchart-Question (1)

Python
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PSEUDOCODE AND FLOWCHART EXERCISE

Exercises 01

Write a detailed set of instructions, in the correct order, to complete the task. Make sure every step needed is
included! Don’t forget to ask extra questions if you need to.

Before your first step, write down all the assumptions you have made in order to produce the solution (e.g. in
question 1 you have to assume that the person following the instructions has electricity or a stove or wood to
make a fire and a kettle or a pot).

Follow the 5 major steps when solving these problems.

1. Make one cup of coffee.

2. Buy a loaf of bread from the local shop.

1. A pseudocode and flowchart are required to read three numbers, add them
together and print their total.

2. Draw a flowchart and write a pseudocode that will ask the user to input two
prices and then add them together. If the total is greater than 100 then a 10%
discount must be subtracted from the total. The final total (after the discount)
must then be displayed.

3. Consider that you are asked to write pseudocode and draw the flowchart for
the following program:
Accept the opening balance, withdrawals and deposits into a bank account for
the month. Calculate the closing balance at the end of the month as follows:
Subtract the withdrawals from the opening balance and then add the deposits.
If the closing balance is > 0, add 5% interest to the closing balance. Display
the closing balance.
If the closing balance is <= 0, display the message “YOU HAVE SPENT ALL
YOUR MONEY!”

4. Potsdam Primary School requires a program that will act as a simple calculator.
The program must be able to do addition, subtraction, multiplication and division.
Each of the operations must be represented by a button. The user must enter
two numbers and then click a button (add, subtract, multiply or divide).
If the data is valid, the program must then perform the required operation
and display the result: see the data validation below.
The user must be allowed to do any number of calculations.
The program must end when the user clicks an exit button.

Data Validation:
1. If the user enters anything other than a number: display an error message,
do not perform the operation and display 0 as the result.
2. If the user tries to divide by 0 (the second number is 0): display an
error message, do not perform the operation and display 0 as the result.

You might also like