iii. Travel costs (including petrol)
iv. Cell phone and telephone
v. Other expenses
2. The user shall be able to choose between renting accommodation or buying a property.
3. If the user selects to rent, the user shall be able to enter the monthly rental amount.
4. If the user selects to buy a property, the user shall be required to enter the following
values for a home loan:
a. Purchase price of the property
b. Total deposit
c. Interest rate (percentage)
d. Number of months to repay (between 240 and 360)
5. The software shall calculate the monthly home loan repayment for buying a property
based on the values that the user entered.
6. If the monthly home loan repayment is more than a third of the user’s gross monthly
income, the software shall alert the user that approval of the home loan is unlikely.
7. The software shall calculate the available monthly money after all the specified deductions
have been made
Here is my program:
static void Main(string[] args)
{
int Choose;
int salary;
int monrentalamount = 0;
int valuehomeloan = 0;
int purprice = 0;
int totaldep = 0;
int interrate = 0;
int nummontorep = 0;
int availmonmoney;
int monhomeloanrepay;
Console.WriteLine("Enter salary: ");
salary = Int32.Parse(Console.ReadLine());
Console.WriteLine("Choose between renting accommodation or buying a property: ");
Console.WriteLine("1) Renting accommodation: ");
Console.WriteLine("2) Buying a property: ");
Choose = Int32.Parse(Console.ReadLine());
if(Choose == 1)
{
Console.WriteLine("Enter the monthly rental amount: ");
monrentalamount = Int32.Parse(Console.ReadLine());
}
else
{
Console.WriteLine("Enter: ");
Console.WriteLine("Values for a home loan: ");
valuehomeloan = Int32.Parse(Console.ReadLine());
Console.WriteLine("Purchase price of the property: ");
purprice = Int32.Parse(Console.ReadLine());
Console.WriteLine("Total deposit: ");
totaldep = Int32.Parse(Console.ReadLine());
Console.WriteLine("Interest rate (percentage): ");
interrate = Int32.Parse(Console.ReadLine());
Console.WriteLine("Number of months to repay (between 240 and 360): ");
nummontorep = Int32.Parse(Console.ReadLine());
}
monhomeloanrepay = valuehomeloan / nummontorep + valuehomeloan;
Console.WriteLine("Monthly home loan repayment for buying a property" + monhomeloanrepay);
availmonmoney = salary - totaldep + interrate;
Console.WriteLine("The available monthly money after all the specified deductions have been made: " + availmonmoney);
}
Comments
Leave a comment