escription

What to do?
An online bank wants you to create a program that shows prospective customers how their deposits will grow.
Your program should prompt the user for initial balance and the annual interest rate in percent. Choose double
datatypes for variables to store initial balance and annual interest rate that you received from the user. Interest
is compounded monthly. Computer and print out the balances after the first three months.
Test your program when user gives initial balance as 1000 and interest rate as 6. Here is a sample run:
Initial balance: 1000
Annual interest rate in percent: 6.0
After first month: 1005.00
After second month: 1010.03
After third month: 1015.08
Your program should have only one class, all code goes in the “main” method. See starter code on Blackboard.
What to turn in
A) Submit your JAVA source code as a .java file. Only one of the partners should individually upload the
.java file via Blackboard. Write yours and your partner’s name, and “Homework #3” at the top of your
.java file as comments as illustrated below.
CS 101 – Foundations of Computer Science
Page 2 of 3
B) Submit a written report electronically as a PDF or MS Word doc file through Blackboard. Again, only one
of the partners should individually upload the report. Write yours and your partner’s name, and
“Homework #3” on the first page of your report. Your report should include:

  1. Large and readable screen shot of the output window of your program run (the output is displayed at
    bottom of the screen in your JGrasp or Eclipse window). Use the aforementioned numbers in the
    problem description as sample run.
    Note: Please only use the links provided under Blackboard in Homework to upload your homework.
    Submissions directly to my NJCU email or via Blackboard message feature will not get graded.
    What is considered legitimate collaboration VS plagiarism/academic dishonesty?
    (Refer syllabus). Academic dishonesty will be dealt strictly and in accordance with university guidelines.
    Additional Notes
    You may lose points if you don’t pay special attention to the following in your program:
    • Your code should be properly indented. Separate various sections of your code with a blank line, like
    variable declaration, taking input, computation, printing, etc.
    • Pay attention to naming convention for variables and objects. Variables and objects are declared in
    lower case, use camel casing for multi word names.
    • Document your code by writing comments where appropriate to explain what the various pieces of
    your code might do.
    • Each line should not have too much code, as a matter of practice any line longer than 80 columns should
    be broken down into multiple lines of code.
    CS 101 – Foundations of Computer Science
    Page 3 of 3
    Commenting your code
  2. File comments: Start your .java file with a description of your program, names of authors, date
    authored, and version. Add other comments as asked in the “what to hand in” section of this document.
  3. Section comments: Add comments for each section of your code within your function like variable
    declaration, taking input, computation, display output, etc.
  4. Explanatory comments should be added for tricky or complicated or important code blocks.
  5. Line comments: Lines that are non-obvious should get a comment at the end of the line. These end-offline comments should be separated from the code by 2 spaces. Break long comments into multiple lines.
    Hint: a screenshot of input/output window
    This project requires that you take a screenshot of the output window of your program run (the output is
    displayed at bottom of the screen in your JGrasp or Eclipse window).
    On Windows OS:
  6. First, make sure your JGrasp/Eclipse window is in focus (otherwise click on it to bring in focus).
  7. Next, you can take a screenshot by simultaneously pressing “alt” and “prt sc” keys on the keyboard.
  8. That copies an image of the JGrasp/Eclipse window to the clipboard.
  9. Then, you should be able to paste (CTRL-V) the image into a word processor such as Microsoft Word.
    On MAC OS
  10. Press Command (⌘)-Shift-4. You’ll see that your cursor changes to a camera pointer.
  11. Press the Space bar.
  12. Move the camera pointer over the window to highlight it.
  13. Click your mouse or trackpad.
  14. Find the screenshot as a .png file on your desktop

Sample Solution

This question has been answered.

Get Answer