Project Link: https://www.thecsharpacademy.com/project/11/calculator
First part was guided project based on Microsoft tutorial: https://learn.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-console?view=vs-2022
- Create a functionality that will count the amount of times the calculator was used.
- Store a list with the latest calculations. And give the users the ability to delete that list.
- Allow the users to use the results in the list above to perform new calculations.
- Add extra calculations: Square Root, Taking the Power, 10x, Trigonometry functions.
-
File Handling & Persistence – This was my first project involving reading and writing to external files, which introduced me to file I/O operations in C#.
-
JSON Data Handling – I discovered JSON objects and learned why they are commonly used for storing structured data.
-
Refactoring for Flexibility – Initially, the calculator was designed around operations requiring two operands. However, advanced functions (e.g., square root, sine) often require only one operand. I refactored the code so that the operation is selected first, making the calculator more flexible.
-
User Input Validation – I realized the importance of validating user input to prevent errors and crashes, improving overall program stability.
Microsoft tutorial: https://learn.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-console?view=vs-2022
Tim Corey's video regarding working with text files: https://www.youtube.com/watch?v=cST5TT3OFyg&
Various Stack Overflow Discussions