0% found this document useful (0 votes)
17 views4 pages

REMEMBER

Uploaded by

tobias
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views4 pages

REMEMBER

Uploaded by

tobias
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

CONFIDENTIAL & RESTRICTED

so thats how the calculor operate


>>PROGRAM.CS
next I would like discuss the changes and the codes I added to make this
work
- ok first lets start here in the program class
- so here, there is actually a code for list here but I remove it and transfer it
here because this code is not useful here
here in this else because
- so here where user can input any numbers and operation they want
- and read the inpur
- for this if else. this check if the input value is decimal. this convert input to
decimal and add it on the list which is input
numbers
- then this else or this condition will let the user exit if x is clicked.
- while in this condition, when the user input either of this operation it will
excecute the codes here
- so here the inputNumbes are converted to array because the number in
calculator input is an array and store it here
- same then operation is store here
- then for this line of code. once numbers and operation are assigned. it will
be assigned yo calculatorinput object.
- basically what happen here is that the equation done is stored here
- then this code is where we process the data where we compute the data.
- and then finally print the result
- Then for this condition. if the user accidently type wrong input like enter
without any inputs, accidentally include other
CONFIDENTIAL & RESTRICTED

characters. it will prompt Invalid Input, Try Again.


- then this one is responsible for creating the json file or the history
- existing class na sa c# kukunin yung date and time and convert it to string
- Then formatted it to where the space, slash or semicolon will change to an
hypen and add .json
- so this will be the file name that will be generated
- store lahat ng laman ni calculator input

>> CalculatorInput.cs
- so here i jsut change this from array to a list where all inputdata are stored
here. i change it to list because with list i dont need
to specify the size and just add and add to the list. because do not now how
many the user will input

>> CalculatorManager.cs
- so here I change the foreach to aggregate. Aggregate is already existing in
c#
- aggregate is a function for list. which accept callback
- Callback - is like a parameter but accept another function that will be
executed by aggregate function
- i, j = yung aggregate function tumatangap sya ng call back function na may
parameters na i and j
- so what the code does is add the values of i and j
CONFIDENTIAL & RESTRICTED

>> Openfiles.ca
- next lets go here in openfile class
- so here this just read the context of the file as a string
- then it created an instance of calculatorinput
- then this converted the json file. the
- json file is converted to object and assign to the calculator input
- then return the calculate input
- for this. i created another method which
can write the obje and convert it to json.
- then save it to file
- yung mga nainput ko dito mapupunta

>>UNIT TEST
- here input will be stored
- since inputdata array we store all inputs. we passed new instance inputdata
because inputdata array are list of inputdata
- para magkapag store ng value kay inputdata we need to pass a new instance
of input data. kaya nag pasa lng here ng new input data
- kaya need magpasa kasi hindi makakapag store ng number or operation
kung walang instance ng input data sa loob ng list ng inputdata
- here we access the new instance by index 0 then add the operation +
- this is the input numbers

-expected and actual


CONFIDENTIAL & RESTRICTED

- actual - so here we are just creating an instance of calculator manager, we


access its process data function (dito naccompute) and then the result
- so this create an instance for calculator manager then access the process
data function and then access the result

>>HISTORY UNIT TEST


-so here store the input data or actual value. where the input data will be
stored in the inpitdatarray
- store here the numbers
- store here the operation
- after inputeed a value on inputdata. it will be stored here in the
inputdataarray
- write here the input data in the file. test.json

- yung ni read ko
- inputData.Numbers this is variable pwede yung operation and numbers
mismo or yung variable na lng

You might also like