作业GUI | javafx | java | css – 这是一个关于css的题目, 主要考察了关于javafx等方面的内容,是一个比较经典的题目, 包括了GUI/javafx/java/css等方面，是一个gui设计的题目
- [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
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 your objective.
Full points will be awarded only if your GUI adheres to all the requirements.
Submission: Please submit your implementation to Moodle at the link Midterm 3 Implementation as a .zip file containing all your . java code no later than 9:30 AM on Sunday December 2.