1. An experiment requires you to throw a dice once, then a coin once and finally a dice once.
If you get
an even number on the first dice, you win N$100. If you get an even number on the first dice and a
head on the coin, then you win N$250. If you get an even number on the first dice, a head on the
coin and an odd number on the second dice, then you win N$700. You perform the experiment only
once.
Draw a flowchart that reads each score and outputs the amount won for this experiment.
Write a pseudocode program that inputs each score and outputs amount won.
2. There are 50 names on a list.
Draw a flowchart that reads the first three letters of each name and outputs all the names that
start with SAM and how many they are. (Assume that all names are longer than two letters. Also
note that only one letter can be read at a time.)
Write a pseudocode program as well.
3. An automobile dealership uses CODE = 1 for new automobiles, CODE = 2for used automobiles, and
CODE = 3 for separate accessories. A salesman’s commissions are as follows: on new automobile, 3%
of the selling price but a maximum of $300; on used automobile, 5% of the selling price but with a
minimum of $75; on accessories, 6% of selling price.
Draw a flowchart and write a pseudocode programme with input CODE and PRICE and output
COMMISSION.
4. The monthly charge for local telephone calls is as follows:
$8.00 for up to 100 calls
Plus 6 cents per call for any of the next 100 calls
Plus 4 cents per call for any calls beyond 200
Draw a flowchart and write a pseudocode programme with input the number of LOCAL calls and
output CHARGE.
5. Three positive numbers a, b, c can be the lengths of the sides of a triangle provided that each
number is less than the sum of the other two sides, i.e. a < b + c or b < a + c or c < a + b . Draw a
flowchart and write a pseudocode programme that will input a, b, c and out put ‘YES’ or ‘NO’,
according as a triangle can be formed or not.
6. Suppose that y is the function given as y = 2t 3 − t 2 − 37t + 36 .
Draw a flow chart and write a pseudocode programme which outputs the value of y for each t
from −5 to 5 in steps of 0.25 , and finds the maximum of the calculated values of y .
7. Write a DOWHILE structure that finds all pairs of positive integers m , n such that m 2 + 2n 2 < 100 .