Topics : Introduction to Problem Solving
1. a) Input : P,Q,R,S
Process : mean = (P + Q + R + S) / 4
Output : Mean of P,Q,R,S
b) Input :length in mm
Process :length in cm = length in mm / 10
Output : length in cm
c) Input :
radius, height
Process :
calculate vol, determine appropriate message if volume is below 12cm^3, or more than 12cm^3.
Output :
“Accepted” or “Not Accepted”
2. a)
b)
3. Write the algorithm
- a) Start
Set payment = 0;
Enter payment, noOfdays; //no of days after notice
If noOfdays <= 10;
discountprice = 0.95*payment;
print discount price;
else
print payment;
End
- b) Start
SET i=1
while i <= 12;
Enter integer;
calculate multiplication = integer * i;
print multiplication;
i = i+1;
end while;
End