Hey,
Im writing an interest program for in java and i ahve a question about an easier method to obtain the user input. I have to get the amount the user wishes to input, the % interest, the annual rate (36 months, or 2 years ) and the compound rate ( monthly, daily, yearly). I need a better way to find out if the user has inputed 36 months or 2 years, same thing with the compound rate. As it is now, im using ALOT of if statements, there has to be a better way.

Re: java interest program help? 80 80

You could create methods that return different values based upon the input, but you still need if statements to do that. Would it be possible for me to see what you have? It would be much easier for me to help.

Re: java interest program help? 80 80

... an easier method to obtain the user input.

easier compared to what? and what do you have to test on? perhaps you do need all those if's

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.