Question: Write a java program that calculates the accommodation cost of a holiday resort for a family (mom, dad, and kid(s)) based on the rules below.
Write a java program that calculates the accommodation cost of a holiday resort for a family (mom, dad, and kid(s)) based on the rules below.
The program will take two integer inputs, the number of kids and the number of days in order.
- The price per person is 100 TL per day without any children,
- The price per kid 50 TL per day if the number of kids n is 1<=n<=3
- The price for each kid is 30 TL per day if there are more than three kids.
Input Format
- The number of kids n is an integer value
- The number of days d is an integer value
Constraints
n>=0 and d>0
Output Format
The program should print the total cost in a message like "the total cost is 300 TL" when the input values are 2 1 (n = 2 and d = 1)
Sample Input 0
2 1
Sample Output 0
the total cost is 300 TL
Sample Input 1
5 2
Sample Output 1
the total cost is 700 TL
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
