IFSelection
IFSelection
The company pays its employees according to the position(0: Engineer, 1: Technician) of the
employee in the company and the number of hours worked. Employees will be paid an overtime
rate of 1.5 times of the employee’s basic pay if the total number of hours worked exceeds 160
hours. The hourly rate for an Engineer and Technician is $30.00 and $25.50 respectively. Write a
pay calculator to compute pay of an employee of a given position and the number of hours
worked.
2. Write a fragment of code which computes and display the profit for selling an item based on
the type of the item and the price of the item. Assume there exit 2 variables, an integer type to
indicate type of the item and a float price to indicate the price of the item. You should use the
conditional statement to compute the profit based on the following criteria.
type price profit
0 Less than $20.00 10% of the price
(clothes) $20.00 to $50.00 15% of the price
Above $50.00 20% of the price
1 Less than $5.00 5% of the price
(shoes) Or above $30.00
$5.00 to 30.00 10% of the price
4. Write a fragment of code which computes the interest for housing loan of a local bank. The
interest calculation is based on the type of account, the amount loan and the loan period. Assume
there exit 3 variables, a String accountType to indicate account type of loan, a float amt to
indicate amount loaned and an integer year to indicate the loan period .You should use the
conditional statement to compute and store the interest in a float variable interest based on the
following criteria.