Question
THIS PROGRAM HAS TO BE WRITTEN USING JAVA. NOT (JAVA SCRIPT) , (NOT C++), (NOT C#). BUT JAVA WITH NETBEANS IDE. The program has to
THIS PROGRAM HAS TO BE WRITTEN USING JAVA. NOT (JAVA SCRIPT) , (NOT C++), (NOT C#). BUT JAVA WITH NETBEANS IDE. The program has to look like this.
PLEASE FOLLOW THE DIRECTIONS.
Consider the following requirements:
Graphic interface design
a) Create a class called AthleticRaceInterface and add the corresponding graphical elements, as shown in the image.
b) Notice in the image that the window consists of three sections:
Number 1: a text field and a button to register the runners in the system.
Number 2: it's a JTextArea that shows the registered participants so far.
Number 3: consists of four graphic elements.
c) A JTextArea that shows the order in which the competitors reach the finish line.
d) Three buttons to start the run, reset the run, and end the execution of the program.
Programmation logic
a. Create a wrapper class called Runner to register runners; this class will have name and speed attributes.
The name attribute corresponds to the name of the runner and the speed attribute to a random number between 0 and 30 (you can use the random method provided by the Math class).
b. In the AthleticRaceInterface class you must define an array of type Runner with five elements; in this way, the system will accept a maximum of five runners.
When the user presses the Register button, the program must validate that the name of the runner is not empty and that it does not exceed the size of the array (add the corresponding messages so that the user knows what is happening internally in the system. You can use the class JOptionPane).
c. When a user is registered correctly, it should appear listed in the JTextArea belonging to section 2 of the window (registered brokers).
d. With the Start button and to start the race, it must be validated that the five runners are registered.
and. e. The Reset button should clear all the values of the variables in the class, as well as the data in the JTextArea.
F. Finally, the Finish button should close the program.
AthleticRace Runner resgistration
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started