Variable numbers and arithmetic operations Solved

25.00 $

Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment


5/5 - (1 vote)

Variable numbers and arithmetic operations can be used to differentiate in different forms and achieve different arithmetic expressions and hence different results. For example, from numbers {4,5,3,2,10,1} and {+, *},

• 5*3+2+(1+10)*4

• (1+5)*10+2*(3+4)

Two different Expressions can be obtained (of course there are others). In this homework you will try to get the data as a result by dividing the number of records and arithmetic operations. But there are some pieces of homework, and they are explained below. You will read from the keyboard first. The numbers and results you will use in the first line will be included.

2 5 1 4 10 3 45

In the second line you will be able to use arithmetic operations:

+ * /

In this example, you need to get 45 numbers using {+, *, /} operations from {2,5,1,4,10,3}. You have to use all numbers and numbers can not be used more than you can. We will assume that the results of narrowing the result set to be searched should be in the below format.

Let the number of rows be X = {x1, x2, x3, … xn}. In this case the format is:

Xi ? (Xj ? (Xk ?( Xl ?…….?(Xt ? Xz))))

(i, j, k, l, t, z ? {1, 2, …, n}).Here ? shows any kind of arithmetic operations. The above is the example from the above. Results that you can find in the results are:

4 + (5 + (3 ? (2 + (10/1))))

There can be more than one result, it is enough to give only one result in this case. You do not have to use all of the Transactional Operations, but you can not use any Transaction other than the data. The number of dots will only consist of integers. You should also use integer arithmetic in the Operations you will perform, including splitting. If you can not find the number of results you are looking for, the number of digits in the dice and arithmetic operations, you should find the closest result you can find. The output should be in the following order.

4 + (5 + (3 ? (2 + (10/1))))