Tugas Kuliah Apaan Yak

Embed Size (px)

DESCRIPTION

Tugas Kuliah Apaan Yak Tugas Kuliah Apaan Yak Tugas Kuliah Apaan Yak Tugas Kuliah Apaan Yak Tugas Kuliah Apaan Yak

Citation preview

  • 52 1 Simple program design

    4 Design an algorithm that will receive the weight of a parcel and determine the deliv- ery charge for that parcel. Calculate the charges as follows:

    5 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 accompany- ing discount amount as follows:

    Parcel weight (kg) 5 kg

    Cost per kg ($) $3.50 per kg $2.85 per kg $2.45 per kg

    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.00 of the cost of a building and 3% on the remainder if the remainder is less than or equal to $80000.00 or 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:

    Pricing code

    H

    F

    T

    Q z

    Discount rate

    50%

    40%

    33%

    25%

    0%

    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.

    Loan ($) less than $25 000 $25 000-$49 999 $50 000-$100 000

    Deposit

    5% of loan value $1 250 + 10% of loan over $25 000 $5000 + 25% of loan over $50 000