Problema Solution

A computer takes 3x2 + 2 milliseconds to process a certain program. If the program has 4 lines of static code (this will always be required for the code to run) and x variable lines, what is the average amount of time it takes to process each line?

Answer provided by our tutors

A computer takes 3x2 + 2 milliseconds to process a certain program. If the program has 4 lines of static code (this will always be required for the code to run) and x variable lines.

=> the program takes 3x2+2 time to complete x dynamic and 4 static instructions.

=> Average time per instruction = total time / total lines

=> (3x2 + 2) / (x + 4)