✅ ✅ C# Academy Calculator Project Challenge -- Counting Times Used
Calculator.mekasu0124/Program.cs - https://pastebin.com/Wvz9eHUM
ClassLibrary/CalculatorLibrary.cs - https://pastebin.com/qucuTXXm
This project had us create 2 projects in one. The calculator and the class library. One of the challenges is to keep track of the number of times the calculator was used. I want to do this based off when the user receives a result, not when the program may error due to
however in
to determine the result and whether it errors or not. Under the line
but this didn't work. So, following the same code patterns and such in the files, how would I increment the usage variable that is wrttien in at the top of the
ClassLibrary/CalculatorLibrary.cs - https://pastebin.com/qucuTXXm
This project had us create 2 projects in one. The calculator and the class library. One of the challenges is to keep track of the number of times the calculator was used. I want to do this based off when the user receives a result, not when the program may error due to
Invalid Inputs, This operation will result in a mathematical error, or Oh no! An exception occurred trying to do the math.\n - Details: ", + e.Message. This project had a requirement of following the tutorial on https://learn.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-console?view=vs-2022 and so I did which is the same code in the top two links. In CalculatorLibrary.cs we usehowever in
Program.cs we use this try case to determine the result and whether it errors or not. Under the line
Console.WriteLine("Your result: {0:0.##}\,", result); I want to add an UpdateCount(); function. I attempted to do but this didn't work. So, following the same code patterns and such in the files, how would I increment the usage variable that is wrttien in at the top of the
CalculatorLibrary.cs file in the public Calculator() function where I have writer.WritePropertyName("Usage"); writer.WriteValue(0);?
