-1

EDITED QUESTION

I made a small sequential program in Java which can calculate my daily bonus for my job. It's not the most beautiful or optimized bit of code but hey it works!

Now it would be cool to have this actually save my input for that day somehow and even when I terminate the program the next time I open it should still have stored that end value somewhere. Maybe even go back to that specific day and check my PPH (productive hours) and maybe even calculate the whole month (which is actually the end goal and track my performance).

Any suggestions?

  • 1
    Does this answer your question? [How do I save a String to a text file using Java?](https://stackoverflow.com/questions/1053467/how-do-i-save-a-string-to-a-text-file-using-java) – Joundill Jun 02 '20 at 00:35
  • First off, congratulations, you sound excited to have written a program that makes your life easier - that's what programming should be about. To make ours easier, try only asking a single question at a time. You asked about coding paradigms (object oriented), data structures (arrays), storage & query (SQL), and maybe algorithms (calculate PPH). If you think about just the single most pressing problem you actually need solved, chances are (1) you'll paste less code (2) you'll only spend time on problems that need solving, and (3) this site can help you. – Jake Stevens-Haas Jun 02 '20 at 04:11
  • @Jake Stevens-Haas yeah pretty excited and yes pretty new to this. Ill only post only the problem next time thanks for the advice because it makes sense! So after some searching i did now make the same code with objects to make it look cleaner. For the part of saving the user inputs and accessing them i found out the best way would be to use SQL so i can read write info to it. A lot to learn i still have ! – Samuel Van Bladel Jun 02 '20 at 08:27

1 Answers1

0

***** Answers I found ******

  1. This is the first one i found but is not super useful if you would like that your colleagues also use your application. For single use and store a file locally it would work. https://attacomsian.com/blog/gson-read-write-json#

  2. Using an SQL data base: https://www.ntu.edu.sg/home/ehchua/programming/java/JDBC_Basic.html