Input the age (int), gender (char) and number of credit hours (int) to be registered from the user.
Calculate the total cost the user needs to pay according to:
1) If the age is less than 18 then the user cannot register more than 12 credit hours, and each hour
costs 1500.
2) If the age is from 18 to 22 inclusive and the gender is female then the first 6 credit hours are free, and the cost of any additional credit hour will be 1000 each. The value of the gender will be ‘f’ or ‘F’ for the female.
3) If the age is from 18 to 22 inclusive and the gender is male then the cost of the first 8 credit hours is 8000, and the cost of any additional credit hour will be 500 each. The value of the gender will be ‘m’ or ‘M’ for the male.
4) If the age is more than 22 then the cost of each credit hour is 2000.
i cant figure the formula for calculating cost of 2) & 3)