CST141 Project 9: Chapter 15
Create an investment-value calculator
--or--
Guess a number game
-
Start a new project in NetBeans named "Project9" and select one
of the two options below:
-
Partial credit assignment (8½ points maximum):
Write the Create an investment-value calculator exercise (Exercise 15.5)
exactly as presented in the textbook and implemented as follows:
-
The monthlyInterest in the formula is the annual interest
divided by 12; then monthlyInterest still must be converted
from a percentage to a decimal by dividing by 100
- Use the JavaFX class
Pos
to right-align all the entries in the TextField
's
- Use the JavaFX class
GridPane
for layout of the form
-
Alternately use the "Simple Interest" formula below to calculate the futureValue
(one point deduction or a maximum of 7½ points for doing this version
of the project)
futureValue = investmentAmount + (investmentAmount * numberOfYears * annualInterestRate)
-
Full credit assignment (10 points maximum):
Create a Guess a number game exercise (not from the textbook) as follows:
-
At the beginning of the
start()
method the application generates
and stores a random number between 1 and 1000
-
Design a form with (1) a
TextField
in which the user enters a number
that is his/her guess of what the random number is (in one way or another prompt
the user to enter their guess of this number into the TextField
);
(2) a Button
which the user clicks to evaluate the guess; and (3) a Label
that
displays if the user's guess was "Too low" or "Too high" or "Correct"
-
Use one or more layout pane's of your own choosing to create the structure of
the window that looks professional and appealing, so additionally pay attention
to the usage of constants from the
Pos
class (one-half point deduction
for "substandard" design layout)
-
The
EventHandler
should evaluate the user's input each time the
Button
is clicked; the user can click over and over again until
the "guess" is correct
-
For full credit add a second
Button
which the user can click
after guessing the number correctly that generates a new random number between
1 and 1000 so the game can be played again (one-half point deduction or a
maximum of 9½ points if this element is missing)
-
Also for full credit include all appropriate exception handling for user
input for an
int
as well as a last "catch all" Exception
(one-half point deduction or a maximum of 9½ points
if this element is missing)
-
(A full point deduction or a maximum grade of 9 points if
both of these last two elements are missing)
- Document the program using the Javadoc standard by:
-
Including a substantive comment statement that describes the
class's or interface's purpose, as well as substituting your name
for the existing @author comment and the assignment due date
for the @version comment that already exist at the top of each new class
-
Entering a substantive comment before each method (including
the constructor) to describe its function along with
@parameter
,
@return
and @throws
tags
-
Students may work on all projects in teams of two or three,
and, if so, all students in the group must submit the same project to their own dropboxes
in Blackboard. In the text box's dropbox, as well as in the source code documentation
(comments), state the name(s) of the classmate(s) with whom you worked.
-
When all steps are finished, create a ZIP archive of the entire project.
The completed project with a copy of all files from the NetBean "Project9" project submitted
electronically via an attachment to a
Blackboard
dropbox is due to Prof. Struck by 11:59 p.m. on the date specified in the course outline.