Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Investment program

KingteranKingteran Posts: 1Member
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

Comments

  • zibadianzibadian Posts: 6,349Member
    : 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.
Sign In or Register to comment.