Hello! We were given a coursework assignment

I have this

Implement the data keeper of the onboard sensors of the aircraft. Memorization is performed when receiving the next signal from the sensor, as well as after a certain time interval. If during the observed period there were no deviations in the sensor readings, ensure that the stored information is compressed. Store records in a file. Use the keeper pattern.

I read about this pattern. But I haven't found any good examples yet. Until I understand how to implement these sensors and the plane itself .. What functions are available to the client.

Can you tell me your thoughts?

  • four
    I was always pleased with the tasks in the "write a quixort style using pointers and the subtraction operation". I used to approach the assignments like this: template <typename T> void quicksort (std :: vector <T> & array) {// 1. take care of formal requirements {T * requiredPointer; int requiredSubtraction = 1 - 1; } // 2. now, the implementation ...} - VladD
  • Well damn. You need objects representing the aircraft and the sensor. Sensors are able, according to your description - what? Provide a value on demand and signal changes (event?). The plane for you is just the keeper of the collection of sensors. Then, your logic subscribes to the messages from the sensors and to the timer, and gets the values. Values ​​are reset to a file with timestamp. If the value has not changed, it is possible not to write down the idea (although then it is not clear, what for the requirement "after a certain time interval"). Fsyo? --- Yes, you need another generator of fake-data that will come from the sensors. - VladD
  • Here is the main question just with the generator as if the data from the sensors .. how can it be programmed? - Ulyana_Seve
  • I still think randomly .. well, it may well be .. and then what functions are available to the user of this program? What do you think? just the program starts, works by itself, records all readings .. and what is the user? I just can’t think up any use cases for the coursework ((( - Uliana_Seve
  • Well, how do you want, and where exactly is the problem? Start a timer and at random times change the value to a random one from a given interval. --- Well, if there is no other data, why not a random one? Or let him tell him where to get fake data from, suddenly he has his own vision. And the user that, let him sit and flick on the light bulb . You can visualize the sensor readings with colored lights for fun, but strictly speaking, this is not necessary. - VladD

0