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

Pseudocode-flowchart-Exercise2

The document outlines exercises for creating pseudocode and flowcharts for various programming tasks, including reading and adding numbers, applying discounts, calculating bank account balances with interest, and developing a simple calculator with multiple operations. Each task specifies the required inputs, calculations, and outputs, along with data validation rules for user inputs. The exercises aim to enhance understanding of algorithm design and flowchart creation.

Uploaded by

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

Pseudocode-flowchart-Exercise2

The document outlines exercises for creating pseudocode and flowcharts for various programming tasks, including reading and adding numbers, applying discounts, calculating bank account balances with interest, and developing a simple calculator with multiple operations. Each task specifies the required inputs, calculations, and outputs, along with data validation rules for user inputs. The exercises aim to enhance understanding of algorithm design and flowchart creation.

Uploaded by

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

PSEUDOCODE AND FLOWCHART EXERCISE

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