Question: Q1. [10 marks] Write a Java program to track how many times the program has been executed. You can store an int representing the count
![Q1. [10 marks] Write a Java program to track how many](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f14ca0b4a62_82466f14ca03c212.jpg)
Q1. [10 marks] Write a Java program to track how many times the program has been executed. You can store an int representing the count in a file, e.g., count.dat.Each time your program is executed, read the count, increment it by 1, and then store it back to the file. If count.dat doesn't exist (e.g., first time to run the program), store 1 in the file. Use binary IO for your code. For this question, just write your code in the main method and declare the checked exceptions in the method's header
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
