# 作业GUI | javafx代做 | java | css – javafx gui

### javafx gui

11

1. [5.5 points] TAKE HOME SECTION (Feel free to tear this sheet off, and take it home with you). Implement a graphical user interface (GUI) in javafx for a personal financial calculator. Your financial calculator should allow the user to perform simple interest and compound interest calculations. For your reference, simple interest is calculated as:

Amount = Principal * ( 1 + InterestRate * Time ),

While compound interest is calculated as:

Amount = Principal * (1 + InterestRate) ^ Time.

You are free to use the notes and the Javadoc on the Internet to implement this, however, you will be required to strictly adhere to the academic integrity policy. Any implementation where entire chunks of code are directly copied from similar implementations will be given a 0.

Requirements for GUI: (a) The GUI should at minimum contain two text fields , one for user to enter the principal amount and one for user to enter the time in months. These should be pre-filled with default values (you are free to choose defaults). The GUI should have labels for both fields describing what they do. [. 5 point]

``````(b) Since the interest rate is typically represented as a percentage, the
GUI should use a slider that the user can interact with to set the
interest rate. As the user slides the slider, the GUI should display the
slider value. The GUI should have a label for the slider describing
what it does. The user should be able to choose a value between 0
and 100 for the interest rate, and your code should convert this value
to a ratio between 0 and 1. [ 1 point]
``````
``````(c) The user should be allowed to choose between simple and
compound interest calculation either by interacting with the GUI
using the mouse or by pressing a keyboard key. You need to
implement both choices. It is up to you what keyboard key you use,
but your GUI should display to the user what key they should press
``````

12

``````and what control they should click with the mouse to switch between
simple and compound interest. By default, the user should be able to
calculate simple interest. [ 1 point]
``````
``````(d) The GUI should have a button that the user clicks to compute the
result and display it to a label or a text field. [.5 point]
``````
``````(e) You need to use  css to stylize buttons and the layout element
containing the controls. [.5 point]
``````
``````(f) Your code should compile and run correctly. [ 2 points]
``````
``````(g) You are free to choose any layout container that helps accomplish