Question

In: Computer Science

Create an Investment application that calculates how many years it will take for a $2,500 investment...

Create an Investment application that calculates how many years it will take for a $2,500 investment to be worth at least $5,000 if compounded annually at 7.5% ( Java Programming)

Solutions

Expert Solution

Java code:

public class Main{
   public static void main(String[] args){
        //initializing investment as 2500
        double inv=2500;
        //initializing year as 0
        int year=0;
        //looping till investment is atleast 1
        while(inv<5000){
            //finding investment
            inv=2500*Math.pow((1+7.5/100),year);
            //incrementing year
            year++;
        }
        //printing the number of years required
        System.out.println("Number of years required is "+(year-1));
   }
}


Screenshot:
Output:


Related Solutions

How many years would it take for an investment to double in dollar terms if invested...
How many years would it take for an investment to double in dollar terms if invested at 4%p.a.? Please give your answer to the nearest whole number
How can we write an application that calculates connascence of an application?
How can we write an application that calculates connascence of an application?
Create an application that calculates and displays the amount of a homeowner’s property tax. The tax...
Create an application that calculates and displays the amount of a homeowner’s property tax. The tax is 1.35% of the property’s assessed value, which will be entered by the user. a. Prepare a Planning Chart for the application. b. Draw a sketch of an appropriate interface. Be sure to follow the GUI design guidelines covered in the chapter. The guidelines are summarized in Figure 2-20. (If you want to include an image in the interface, you can either use your...
In C# Create a GUI application that calculates and displays the total travel expenses of a...
In C# Create a GUI application that calculates and displays the total travel expenses of a business person on a trip. Here is the information that the user must provide: Number of days on the trip Amount of airfare, if any Amount of car rental fees, if any Number of miles driven, if a private vehicle was used Amount of parking fees, if any Amount of taxi charges, if any Conference or seminar registration fees, if any Lodging charges, per...
Create a GUI application in C# that calculates and displays the total travel expenses of a...
Create a GUI application in C# that calculates and displays the total travel expenses of a business person on a trip. Here is the information that the user must provide: • Number of days on the trip • Amount of airfare, if any • Amount of car rental fees, if any • Number of miles driven, if a private vehicle was used • Amount of parking fees, if any • Amount of taxi charges, if any • Conference or seminar...
Create an application that calculates mph or (Miles Per Hour). There should be 2 textboxes for...
Create an application that calculates mph or (Miles Per Hour). There should be 2 textboxes for input, and 2 labels to label the input textboxes. The first textbox should be the miles driven. And the other textbox should be hours taken. There should be a button to calculate miles per hour. And a label or textbox for the results of the calculate. 1textbox for miles [input] 2textbox for hours (time used) [input] 3label for miles textbox 4label for hours textbox...
- How many years will it take for $100,000 to grow to $500,000 if it is...
- How many years will it take for $100,000 to grow to $500,000 if it is invested at an annual interest rate of 9.15%? Round to the nearest 0.01. - You are offered a line of credit with a quoted interest rate of 20% with daily compounding. What is your effective annual interest rate? Round to the nearest 0.01%.
***IN C# ONLY, USING WINDOWS FORMS*** --NO JAVA--. Create a GUI application in C# that calculates...
***IN C# ONLY, USING WINDOWS FORMS*** --NO JAVA--. Create a GUI application in C# that calculates and displays the total travel expenses of a business person on a trip. Here is the information that the user must provide: • Number of days on the trip • Amount of airfare, if any • Amount of car rental fees, if any • Number of miles driven, if a private vehicle was used • Amount of parking fees, if any • Amount of...
How many years will it take $7,000 to grow to $11,300 if it is invested at...
How many years will it take $7,000 to grow to $11,300 if it is invested at 3.25% compounded​ continuously?
How many years will it take $3,000 to grow to $5,700 if it is invested at...
How many years will it take $3,000 to grow to $5,700 if it is invested at 9% ​(A) compounded​ quarterly? ​(B) compounded​ continuously?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT