You are on page 1of 1

52

Simple program design

Design an algorithm that will receive the weight of a parcel and determine the delivery charge for that parcel. Calculate the charges as follows:
Parcel weight (kg)

Cost per kg ($)

<2.5 kg

$3.50 per kg

2.5-5 kg

$2.85 per kg

>5 kg

$2.45 per kg

Design an algorithm that will prompt a terminal operator for the price of an article
and a pricing code. Your program is then to calculate a discount rate according to
the pricing code and print to the screen the original price of the article, the discount
amount and the new discounted price. Calculate the pricing code and accompanying discount amount as follows:
Pricing code

Discount rate

50%

40%

33%

25%

0%

If the pricing code is Z, the words 'No discount' are to be printed on the screen.
If the pricing code is not H, F, T, Q or Z, the words 'Invalid pricing code' are to be
printed.
6 An architect's fee is calculated as a percentage of the cost of a building. The fee is
made up as follows:
8% of the first $5000.00of the cost of a building and
3% on the remainder if the remainder is less than or equal to $80000.00or
2.5% on the remainder if the remainder is more than $80000.00.
Design an algorithm that will accept the cost of a building and calculate and
display the architect's fee.
7 A home mortgage authority requires a deposit on a home loan according to the
following schedule:
Loan ($)

Deposit

less than $25 000

5% of loan value

$25 000-$49 999

$1250

+ 10% of loan over $25 000

$50 000-$100 000

$5000

+ 25% of loan over $50 000

Loans in excess of $1 00000 are not allowed. Design an algorithm that will read
a loan amount and compute and print the required deposit.

You might also like