top of page

Stop Watch

Jan 26, 2018
1 min read

As part of a termly test, we sit a programming exam. This time 1 section was to program a stop watch.

Struggles:

It took a while to figure out how to get the time to change dynamically, I used a previous project where I got the current time to change in real time. I managed to use part of that code to achieve the stopwatch movement.

Final outcome:

The stopwatch changes dynamically for minutes down to the millisecond. Although i cant show it, when the user presses the Start, Stop or Rest button, there is a beep sound which I Incorporated.

As for saving the file, when the user clicks the save button, they are prompted with a dialog box to enter the name they want the file to save as, this then saves the lap times into a text file.

Originally I was going to have the saving function in the 'Lap' button so that every time it was pressed the time would be appended. However I changed that, so it stores the lap times in an array list which using a for loop is then appended into the text file at the end. This means that memory is wasted if the user didn't need to save the file but still wanted to use lap times.

Additionally, the user is able to print out the lap times straight from the program.

  • Interface
  • Time Changing
  • Lap Times
  • Users input file save name
  • Saving confirmation
  • Text File
  • User can print lap times
  • Print Confirmation
  • PDF version of printout


Comments


Featured Posts
Recent Posts
Archive
Search By Tags
Follow Us
  • Black LinkedIn Icon
  • Black Google+ Icon
bottom of page