This is probably a pretty dumb question but here goes. How do I make a users decimal value display as a percentage later in my program. Say if user was asked for interest rate and they put .05. Later...
Type: Posts; User: white97
This is probably a pretty dumb question but here goes. How do I make a users decimal value display as a percentage later in my program. Say if user was asked for interest rate and they put .05. Later...
I figured it out. Thanks for your help!
when they press enter it should return them to the main menu to press a number again. The main menu method is app.displayMenus();
I don't know how to write it though because the else if statement before it confuses me on what to put in the while loops boolean expression
else if(option == 3)
{
while(?)
{
...
The nbrTimesAround would be the same as the variable though. My method to put the parameters into is invest.getFutureValue(numberOfYears, numberOfTimes). So if I wrote it like you said it would have...
Yes it should change. If the user inputs number of years as 10 then it should display values 1-10 in numberOfYears in my algorithm, so:
algorithm -- principal * Math.pow((1 + interestRate /...
I am having trouble with returning to the main menu.
public static void main(String[] args)
{
Project4 app = new Project4();
//Display all Menu options
app.displayMenus();
//Asks...
So even with a loop, I need to pass numberOfYears and numberOfTimes to it every time?
My algorithm method in another class is
public double getFutureValue(int numberOfYears, int numberOfTimes)
{
return principal * Math.pow((1 + interestRate / numberOfTimes), (numberOfYears *...
The variables I need are principal, interestRate, numberOfYears, and numberOfTimes, in the main class and they have to go through to Investment class to calculate the value. I want to display them in...
Do I create my object in the method menu3() or do I have to declare it in the main method?
All the variables have to go through my other class to be calculated into the futureValue variable. Thats what is confusing me. Here is my other class if that helps.
//This class calculates...
Okay, so I have 2 classes (Investment and Project4)
This program is designed to display 5 menu options.
The first menu option asks the user for a starting balance and an interest rate
The second...