INSTRUCTION
1.
2.
3.
4.
5.
12 8 4
A 14 10 6
16 12 8
0
2
4
4
2
0
compounded yearly/montly/daily means that at the end of one year/month/day the interest is
added to Mr. Rahim balance.
Write a Matlab programme where the output will display the total amount of saving that Mr. Rahim
expected to have in each of the bank after he have invest for one year and also display the Bank that
offer the best deal.
Q8: Write a program in a script file that calculates the cost of mailing a package according to the
following price schedule:
Type of Service
Ground
Weight 0 2 kg
RM 1.50 per Kg
Air
RM 3.00
Overnight
RM 11
Weight 2 10 kg
RM 1.50 + RM0.50 for
each kg or fraction of a
kg above 2 kg.
RM 3.00 + RM0.70 for
each kg or fraction of a
kg above 2 kg.
RM 11.00 + RM 2.50 for
each kg or fraction of a
kg above 2 kg.
Weight 10 50 kg
RM 5.00 + RM0.50 for each kg
or fraction of a kg above 10 kg.
RM 7.00 + RM 0.60 for each kg
or fraction of a kg above 10 kg.
No overnight service
packages above 10 kg
for
The program asks the user to enter the weight and the type of service. The program then displays
the cost. If a weight larger that 50 kg is entered for ground or air services, a message Ground (or
Air) services is not available for packages that weight more that 50 kg is displayed. If a weight larger
than 10 kg is entered for overnight services a message Overnight service is not available for
package that weight more than 10 kg is displayed.