Java

Moderators: zibadian
Number of threads: 7836
Number of posts: 18235

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Investment program Posted by Kingteran on 3 Apr 2006 at 7:01 PM
Here is what I want to do I just dont know how to do it.

Create a program that will accept a person's first name as an argument passed when the program is invoked. It will use the name passed to personalize the three questions in the file created. The questions MUST be read from the file. The personalized questions are to be asked to the user where 1 question uses the console and the other two questions use a dialog box (JOptionPane). Use the answer to the questions to tell the user how much their investment will be worth when the time period is over.

Here is the text (questions) from the file
How much are you investing today?
How long will you be investing for?
What is the interest rate that your investment will be earning?

If someone could show me how to do this that would be fantastic.

KingTeran
Report
Re: Investment program Posted by zibadian on 3 Apr 2006 at 9:56 PM
: Here is what I want to do I just dont know how to do it.
:
: Create a program that will accept a person's first name as an argument passed when the program is invoked. It will use the name passed to personalize the three questions in the file created. The questions MUST be read from the file. The personalized questions are to be asked to the user where 1 question uses the console and the other two questions use a dialog box (JOptionPane). Use the answer to the questions to tell the user how much their investment will be worth when the time period is over.
:
: Here is the text (questions) from the file
: How much are you investing today?
: How long will you be investing for?
: What is the interest rate that your investment will be earning?
:
: If someone could show me how to do this that would be fantastic.
:
: KingTeran
:
First create a new JFrame class, and implement the main() method in it. In the main() open the fire and read the questions. The main() method has an array of strings, which represent the command line parameters of the program (i.e. the name). You could use the Scanner to insert the name into the questions.
Now for the user interface: The console can be accessed using the System.out and System.in variables. Create 2 appropriate JOptionPane-s with the other two questions and get the response. The cast each of those answers to doubles.
Finally the calculation and result. Take the three responses and calculate the size of the investment after the alloted time. These calculations are well known and documented, so I leave them to you. Finally either use one of the JOptionPane-s or the console to show the result.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.