less than 1 minute read

Introduction

Today, I worked on creating a method to save the results and recommendations of the AI Risk Classification tool to a txt file.

Development Notes

First of all, I imported java.io.* to import the whole package. Then, I modified the main method to ask the user if they want to save the results to a file, and I call on fileResults to save the results to a txt file

Screenshot 2025-05-18 at 12 06 24 PM

In the fileResults method, I put everything in a try/catch block to catch any IOExceptions. I also ensured that the file name ends with “.txt” and I use fileWriter and BufferWriter for efficient file writing

Screenshot 2025-05-18 at 12 07 44 PM

Then, I simply reprint the results in this format:

  • Header
  • System details
  • Classification results
  • Risk category explainations
  • Recommendations
  • Disclaimer

Screenshot 2025-05-18 at 12 10 49 PM Screenshot 2025-05-18 at 12 11 07 PM Screenshot 2025-05-18 at 12 11 20 PM

I also ran a sample run to ensure that all the information is saved to “sample.txt” properly

Screenshot 2025-05-18 at 12 12 35 PM

Moving forward, I will work on the frontend to improve the UI/UX of the tool