Hello. They asked me to write a program, .. there is a condition, but for me it is somehow poorly understood. Here it is:
Let some device as a state contain a number from 0 to 126. At each subsequent time, the number changes according to the formula x (n + 1) = a * x (n) + b (mod127), where a = 10, b = 11. Create a class that displays this device.
The class must have member functions:
- the constructor with the argument is the initial state,
- function that takes the device to the next state,
- a function that displays the status of the device.
Are x (n + 1) and x (n) the next and previous values? What is it all about? Can you hint an algorithm? There is no way for a lecturer to ask a simple task to verify the mastering of information ...