{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Assignment2

# Assignment2 - Department of Computer Science The University...

This preview shows pages 1–2. Sign up to view the full content.

Department of Computer Science The University of Hong Kong CSIS1117A Computer Programming Assignment 2 Due Date: 23:59 Oct 9, 2009. You may assume all input are valid in these exercises. 1. The Government of Green Island is charging tax according to the follow table. Income Tax Rate First \$100,000 Tax free Next \$50,000 10% Next \$100,000 20% Remaining 30% A flat rate of 20% is imposed on the tax, so that if the tax payable according to the above table is higher than 20% of total income, the tax payable will be 20% of total income. Write a program (tax.cpp) to find the tax payable given the total income. Assume that the input is a positive real number. And output the tax payable to the nearest integer. Sample run of the program: Sample Run 1: Enter total income: 360000 Tax payable is 58000. Sample Run 2: Enter total income: 80000 Tax payable is 0. Sample Run 3: Enter total income: 600000 Tax payable is 120000. 2. The Body-Mass Index (BMI) is defined as BM I = w h 2 , where w is the weight in kg, and h is the height in m. BMI reflects the obesity of an adult, according to the following table: BMI Range Obesity BMI ≤ 25 Fit

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

Assignment2 - Department of Computer Science The University...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online