Algorithm Toreisia Johnson
Algorithm Toreisia Johnson
iv. The names of TWO different variables- The names of two different
variables are:
1. Price
2. Enter
b. Explain the following:
Form 4 Assignment
Answer all questions on this sheet, save as Algorithm your name.
i. : This backward arrow is present in the Algorithm in question 3 at
Line 2, in line 2 consists of the OUTPUT needed to solve for the
problem. The backward arrow is showcasing or directing that 3 is
the price per minute, which is the OUTPUT or raw information
needed to complete the task.
ii. DIV: DIV is used in integer division, for example: 10 DIV3, which
is equal to 3, in this case, 10 and 3 would be referred to as the
integers. DIV is an Arithmetical operator which takes two operands
of integral type, performs integral division, and the results is a
value of integral type. In the algorithm contained in question 3, you
are going to DIV the phone card price and the price per minute
which is the talk time. When you are working out the algorithm to
solve for the problem, you are required to DIV the numbers.
4. Write simple algorithms (similar to QU 3 but without the line labels)using the
appropriate VARIABLE NAMES and OPERATORS for each of the following
problems. (It may help to think of each as a maths problem first)
a. To find the average price of three items in a shop.
b. To calculate the bonus a salesman receives if he/she gets 12% of his/her
total sales as a bonus
c. To calculate the area of a triangle.
d. To calculate the amount of a phone bill if calls cost 49c per call. Extra
credit if you can show the amount in $ instead of cents.
EXTRA CREDIT WILL BE GIVEN IF YOUR FINAL OUTPUT STATEMENT CONTAINS
WORDS AND VARIABLES AS GIVEN IN CLASS.
Answers for Question 4.
a. To find the average price of three items in a shop
START
OUTPUT
INPUT
newprice
OUTPUT
STOP
b. To calculate the bonus a salesman receives if he/she gets 12% of his/her total
sales as a bonus
START
OUTPUT
INPUT
newprice
OUTPUT
Form 4 Assignment
Answer all questions on this sheet, save as Algorithm your name.
c. To calculate the area of a triangle
START
OUTPUT
INPUT
Area
OUTPUT
STOP
d. To calculate the amount of a phone bill if calls cost 49c per call. Extra credit if you
can show the amount in $ instead of cents.
START
OUTPUT
INPUT
phonebill
OUTPUT
STOP
Enter the amount of a phone bill if calls costs 49c per call
amount
amountcosts * 49
The phonebill are $, phonebill