Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project 8 Specifications Create a JavaFX program that will allow the user to choose a planet. Once a planet is chosen, the user will then

image text in transcribed
Project 8 Specifications Create a JavaFX program that will allow the user to choose a planet. Once a planet is chosen, the user will then select to display certain details about the planet that has been chosen The user may select to display the planet's surface area, circumference, distance from the sun, and/or a corresponding weight on that planet. The Input File The input file - PlanetInfo.txt - contains the following information: planet name, planet radius, planet weight ratio, planet distance from the sun Each value is separated by a comma (,). For example: Mercury, 2440, 0.378, 0.39 indicates the following: planet name is Mercury Mercury's radius is 2440 km Mercury's weight ratio to Earth is 0.378 - The distance from the sun to Mercury is 0.39 AU (astronomical units) Units of Measurement Be mindful of units of measurement: the radius value is given in km the input weight/output weight in kg the distance from the sun is measured in AU each calculated value should indicate appropriate units of measurement Controls: Using RadioButton controls, allow the user to select a planet listed: - Mercury - Venus Earth Mars - Jupiter - Saturn - Uranus -Neptune Using CheckBox controls, allow the user to select one or more of the following: surface area of the planet chosen (measured in km) circumference of the planet chosen (measured in km) distance from the sun (measured in AU) - corresponding weight on the planet chosen (measured kg) If the user checks a checkbox, the corresponding output should be displayed in an output text area. If the checkbox is unchecked, the output should not be displayed in the output text area. Use a button control for the user to press when they have finished selecting options. The GUI form should have as a minimum: Labels, TextField, HBox and/or VBox, RadioButton, Checkbox, and Button controls. Formulas: - set PI to a constant variable = 3.14159 - Surface area = 4 * PI * radius squared Circumference = 2 * PI * radius - Converted weight = weight on Earth * weight ratio Exceptions: Throw the following exceptions: - File not found (FileNotFoundException) - user enters a negative weight value throw a custom NegativeInputValueException exception - user enters a character weight value, such as "thirty" (InputMismatchException) - if the user selects to input a weight and presses the Calculate button, but no weight was entered, throw a custom EmptyStringException exception For each exception thrown, display a dialog box with an appropriately detailed message to the user explaining the problem as described below. NOTE: Be sure to use the throw keyword appropriately to create an instance of the custom exception class designed in the program. When the FileNotFoundExce tion is thrown: display an appropriate error message and the file name the program attempted to find. - once the user clicks on the OK button on the output dialog box, the program should end. When an EmptyStringException is thrown: display the appropriate error message. - once the user clicks the OK button on the output dialog box, set the focus to the input weight TextField control. When a NegativeInputValue exception is thrown: display an appropriate error message along with the invalid input weight entered by the user. - once the user clicks the OK button on the output dialog box, set the focus to the input weight TextField control. When an InputMismatchException is thrown: display an appropriate error message along with the invalid entry made by the user. once the user clicks the OK button on the output dialog box, set the focus to the input weight TextField control. Be sure to make this GUI application look professional and pleasing to the eye. The user should not have to search around the form to find the information they are seeking. Example: (you are free to make your own design as long as it contains the information needed): on the far left a group of radio buttons with each planet listed. Next, a group of checkboxes: surface area, circumference, distance to the sun, and corresponding weight. If corresponding weight selected, a text field of weight input value is enabled. Next, a Display button control. On the far right, a text field displays the values calculated based on the checkbox checks. To Do: 1. Zip the entire project together and upload it into the Project 8 Dropbox. 2. Be sure to review the Specifications before you submit your Project. Do not take shortcuts.go above and beyond what is expected of you. 3. Check the Calendar for the due date! 4. Be sure to use the template code (the file called template code under the Eclipse module in Canvas)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions