Question

In: Computer Science

Dream House Question Part 1 You have graduated from HKBU and now have a great job!...

Dream House Question Part 1 You have graduated from HKBU and now have a great job! You have move to the Central district and decide that you want to start saving to buy a house. As housing prices are very high in Hong Kong especially in Central District, you realize you are going to have to save for several years before you can afford to make the down payment on a house. In this exercise, we are going to determine how long it will take you to save enough money to make down payment given the following assumptions: 1. Call the cost of your dream home t_cost . User input 2. Call the portion of the cost needed for a down payment portion_dp. Assume the portion_dp is 10%. 3. Call the amount that you have saved thus far c_savings. Assume the initial c_savings is $0. 4. Assume that you invest your current savings wisely, with an annual return rate is a_rate (in other words, at the end of each month, you receive an additional c_savings*a_rate/12 funds). User input. 5. Assume your monthly salary is m_salary. User input. 6. Assume you are going to dedicate a certain amount of your salary each month to saving for the down payment. Call that portion_saved . User input. 7. At the end of each month, your c_savings will be increased by the return on your investment, plus a percentage of your m_salary. Write a program to calculate how many months it will take you to save up enough money for a down payment. You will want your main variables to be floats, so you should cast user inputs to floats. Your program should ask the user to enter the following variables: A) The starting monthly salary (m_salary) B) The portion of salary to be saved (portion_saved) C) The cost of your dream home (t_cost) D) The annual return rate of investment (a_rate) Your programs need to provide a reasonable answer for the number of months required to pay the down payment Policy for Collaboration may collaborate with anyone, required to write code independently and write names of all collaborators on submission. *** Will check the similarity of program code submitted

Solutions

Expert Solution

here i am uploading the code for this program

****************** code DreamHouse.java*****************

import java.util.Scanner;

public class DreamHouse {
    static void user_input()
    {
        float m_salary;
        int portion_saved;
        float t_cost;
        int a_rate;

        float portion_dp;
        float c_savings = 0;  // initially current saving is $0
        int required_month;

        System.out.println("\nyour initial current saving is: "+c_savings);

        Scanner scanner = new Scanner(System.in);
        System.out.print("\nEnter your monthly salary is: ");
        m_salary = scanner.nextFloat();
        System.out.print("Enter the portion you want to save from your monthly salary (percent): ");
        portion_saved = scanner.nextInt();

        // current saving updated by how many percent of your monthly salary you want to save plus your initial current saving
        c_savings = c_savings + (float)(m_salary*(portion_saved*0.01));

        System.out.println("\nyour current saving is "+c_savings+" after "+portion_saved+" percent saving from your monthly salary");



        System.out.print("\nEnter cost of your dream home: ");
        t_cost = scanner.nextFloat();

        portion_dp = (float) (t_cost*0.1);  // as the downPayment is 10% of our dream home cost
        System.out.print("\nyour down payment will be: "+portion_dp);

        System.out.print("\nEnter annual return rate of investment: ");
        a_rate = scanner.nextInt();

//        after investing my money very wisely

        c_savings = c_savings +  (c_savings*a_rate)/(12*100);  // now this is actual saving of per month

        System.out.println("\nafter investing my saving with annual return rate of "+a_rate+" percent my current saving is: "+c_savings);

        required_month = (int) (portion_dp/c_savings);

        System.out.println("\n"+required_month+" month required for making "+portion_dp+" down payment");

    }
    public static void main(String[] args) {
        user_input();
    }
}

*************** end of code *********************

now i am uploading the sinppet of the output of this program

snippet1:


Related Solutions

(1) You have just graduated from EOU and secured a job as stock broker working for...
(1) You have just graduated from EOU and secured a job as stock broker working for a regional brokerage exchange. To celebrate your new position, you are going to buy the car/truck of your dreams. You can purchase any car/truck you like, but you cannot spend more than $600/month on the payment. You can take out a 5-year loan. The current interest rate is 5.99% Shop for the car/truck you want on the Internet. Based on these guidelines, how much...
You just graduated college with your Bachelors Degree and accepted a job offer at your dream...
You just graduated college with your Bachelors Degree and accepted a job offer at your dream company. You decided to celebrate by purchasing the vehicle of your dreams. Pictured is a Dodge Challenger HellCat see picture above for $58,995). You have a 720 credit score, therefore you were able to get a 5% interest rate on a 7 year loan. You will be making monthly payments. Using Excel, prepare a professional amortization schedule for the entire 7 years. It must...
Assume you have $1 million now, and you have just retired from your job. You expect...
Assume you have $1 million now, and you have just retired from your job. You expect to live for 20 years, and you want to have the same level of consumption (i.e., purchasing power) for each of these 20 years, after adjusting for inflation. You also wish to leave the purchasing power equivalent of $100,000 today to your kids at the end of the 20 years as a bequest (or to pay them to take care of you). You expect...
You have recently graduated from school and have started your new job at a Consulting LLC....
You have recently graduated from school and have started your new job at a Consulting LLC. You have been given the following assignment. You are to present an investment analysis of a new residential income producing property an investor is considering purchasing. The asking price for the property is $1,200,000; rents are estimated at $201,000 during the first year and are expected to grow at 3.5% per year thereafter. Vacancies and collection losses are expected to be 11 percent of...
4. You have just graduated from nursing school and started a job at the local correctional...
4. You have just graduated from nursing school and started a job at the local correctional facility in the health clinic. Your first client is a female who has just been transferred to the correctional facility today. She has a diagnosis of terminal cancer. You learn she has three children and a husband that are devastated about her incarceration. The client reports being extremely worried about her family. a. What are the potential blocks to the assessment process with this...
Question 1 - Week 1 (7 marks) You have recently graduated from your university course and...
Question 1 - Week 1 You have recently graduated from your university course and start work with an audit firm. You meet an old school friend, Nayan, for dinner — you haven't seen each other for several years. Nayan is surprised that you are now working as an auditor because your childhood dream was to be a ballet dancer. Unfortunately, your knees were damaged in a fall, and you can no longer dance. The conversation turns to your work, and...
You will have to search for your dream house, calculate the down payment, and the monthly...
You will have to search for your dream house, calculate the down payment, and the monthly payments for a 30 and 15 years fixed loan. You will use the loan payment formula to determine your monthly payments for a 30-year fixed loan with an APR of 3.75% and for a 15-years fix loan with an APR of 2.97% with a down payment of 5%. You will make a decision on which loan you would take and provide reasons for your...
You have recently graduated from college, and your job search led you to East Coat Yachts....
You have recently graduated from college, and your job search led you to East Coat Yachts. Since you left the company’s business was seaworthy, you accepted a job offer. The first day on the job, while you are finishing your employment paperwork, Dan Ervin, who works in Finance, stops by to inform you about the company’s 401(k) plan. A 401(k) plan is a retirement plan offered by many companies. Such plans are tax-deferred savings vehicles, meaning that any deposits you...
Imagine that you have decided to acquire your dream car.  You now have to decide whether to...
Imagine that you have decided to acquire your dream car.  You now have to decide whether to buy or lease that car. Write a report specifying the differences between leasing and buying your dream car and make a decision on whether to buy or lease. In writing your report you must do the following: Gather the terms under which you would lease the car, such as the necessary down payment amount and monthly payment amount. Calculate the total costs when leasing...
Use the following information to answer questions 1-4. You have achieved a dream job working for...
Use the following information to answer questions 1-4. You have achieved a dream job working for the Toledo Mud Hens. You estimate the demand for general admission tickets as follows. Price Quantity 15 5000 14 6000 13 7000 12 8000 11 9000 10 10000 The marginal cost of selling a ticket is $2. Other fixed costs per game equal $5000. Finally, the seating capacity is 9000. Question 1 (0.5 points) What is the profit maximizing price? Question 1 options: 15...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT