subject

Sorting an Array of Clocks Displaying in a GUI/Creating a Class Create a class called Clock to represent a Clock. It should have three private instance variables: An int for the hours, an int for the minutes, and an int for the seconds. The class should include a three- argument constructor and get and set methods for each instance variable. Override the method to String which should return the Clock information in the same format as the input file (See below). Read the information about a Clock from a file that will be given to you on Blackboard, parse out the three pieces of information for the Clock using a StringTokenizer, instantiate the Clock and store the Clock object in two different arrays (one of these arrays will be sorted in a later step). Once the file has been read and the arrays have been filled, sort one of the arrays by hours using Selection Sort. Display the contents of the arrays in a GUI that has a GridLayout with one row and two columns. The left column should display the Clocks in the order read from the file, and the right column should display the Clocks in sorted order. The input file Each line of the input file will contain information about a Clock, with each piece of information separated by a colon. An example of the input file would be: 12:31:19 17:23:19 If the line of the file does not have exactly three tokens, do not put it in the arrays, print it to the console. Submitting the Project. You should have three files to submit for this project: Project1.java clockGUI. java clock. java Upload your project to Blackboard by the due date for full credit. Proper Javadoc is expected for the Clock class.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:30
Events and conditions that happen within an organization that are somewhat easier to deal with when responding to change are called
Answers: 1
question
Computers and Technology, 22.06.2019 10:40
Program using c++ only on visual studio pig is a simple two player dice game, played with one die. the first player to reach or surpass 50 is the winner. each player takes a turn rolling the dice. they add to the pot with each roll, having to decide to roll again and increase the pot, or cash out. the risk being they could lose the amount they’ve accumulated into the pot. the rules for each player’s die roll. 1. roll the dice. a. if user rolled a 1, i. the pot gets set to zero ii. the other player goes to step 1. b. a roll of 2-6 is added to the pot. 2. user can choose to hold or roll again. a. choice roll. return to step 1. b. choice hold. i. increment player score by the pot amount. ii. pot gets set to 0. iii. second player gets to roll and goes to step 1. program requirements: ● before each opponent begins ○ output the score for the person and the computer. ○ output the opponents whose turn is beginning and ask the user to hit enter to continue. ● with each dice roll. ○ output the die value, and amount of the round pot. ○ if it’s the users roll ask if they want to roll again ( r ) or hold ( h ). your program should allow r, r, h or h as valid input. if input is anything else, ask the user again until valid input is obtained. ○ the ai will continue playing until the round pot is 20 or more. ● once a player’s score is greater or equal to 50 then they have won, it will no longer ask if they want to keep rolling the die or not. ● once there is a winner ○ score totals are output along with who the winner was. user or computer ○ player is asked if they want to play again y or n. valid input should be y, y, or n, n. ● when a new game starts the starting roll goes to the player that did not roll last. if the user rolled last in the previous game, then the computer rolls first and vice versa. when the program first begins, the player will make the first roll of the first game. development notes : ● you will need a way to roll dice in your program. the rand() function works well, but returns an integer. if we want numbers 0 – 9 we can get the value modulus 10. ● call srand() with a value to seed it. it’s common to seed it with the current computer clock, include ctime, and then call srand(time(
Answers: 1
question
Computers and Technology, 22.06.2019 10:40
"it security policy enforcement and monitoring" respond to the following: describe how monitoring worker activities can increase the security within organizations. describe the rationale that managers should use to determine the degree of monitoring that the organization should conduct. explain the extent to which you believe an organization has the right to monitor user actions and traffic. determine the actions organizations can take to mitigate the potential issues associated with monitoring user actions and traffic.
Answers: 3
question
Computers and Technology, 23.06.2019 02:50
There’s only one game mode that stars with the letter ‘e’ in cs: go. which of the options below is it?
Answers: 1
You know the right answer?
Sorting an Array of Clocks Displaying in a GUI/Creating a Class Create a class called Clock to repre...
Questions
question
Mathematics, 25.05.2021 16:00
Questions on the website: 13722360