Realized calculator function, it gets values from input and realizes arithmetic functions.