Write a program for the arithmetic (negation of an integer, addition, subtraction and multiplication of two integers) of integers using 3's complement representation. The program should include a procedure for calculating each of negation of an integer, addition, subtraction and multiplication of two integers. The integers will use 8-ternary digit positions, in which the left-most position will be used for sign.
Using your program find the ternary representation of each of the decimal numbers 345, -- 297, 18 and ( (345 -- 297) * 18)