develop a program that can help a person with some calculation that will allow him to decide on how much money he should spend on an expensive item. The program should request four different input data from the user (All are integers):
1- His capital
2- The annual percentage that he receives on his capital
3- The amount he can save per month from his salary.
4- The price of the item to buy
Such as:
Enter your capital: 20000
Enter the annual percentage rate: 12
Enter your savings per month: 400
Enter the price of the item: 16250
The program should calculate the number of months the user has to wait in order to be able to buy the expensive item and keep a minimum capital of 10000.
Note: Consider the annual percentage to be applied on the initial capital amount and divided over 12 months.
For example:
12% annual percentage rate ==> 20000 * 12 % = 2400
==> 2400 / 12 = 200 per month
In order to buy the item in the above example, the user has to wait till his capital becomes at least 26250 which is 11 months because each month his capital will increase 600 (400 savings + 200) so after 11 months his total capital will become 36600.
The program should present output similar to the following:
If the capital is 20000 and the percentage rate on it is 12% and the monthly saving is 400
You can buy the item after 11 months
If the user does not have to wait the program should recognize that and present a different output, such as:
Enter your capital: 23000
Enter the annual percentage rate: 9
Enter your savings per month: 500
Enter the price of the item: 12000
If the capital is 23000 and the percentage on it is 9% and the monthly saving is 500
You can buy the item right away!
Note: You should not use a loop for this question
Important: you might want to include the <Math.h> library and use the ceil function which rounds a number upwards.
Example 1
Number = 4.23;
Number = ceil(Number);
//Now Number has the value 5.
Example 2
Number = 4;
Number = ceil(Number);
//Now Number has the value 4.