Good evening! Can you explain? They gave a very difficult task, I can not understand it.

Determine the class of the specified type. Write defined as user-friendly functions of the keyboard input and display routine of data defining objects of this class. Overload the specified operations and functions with the help of complex class functions. Define constructors and destructor.

Bit string

<, > == long abs() 
  • value comparison
  • equality test
  • the value of the number specified by the bit string
  • Some horror. - skegg
  • I write in PHP and in C ++ I started well, I am not used to complaining, but I have never met with this ever. - Goldy
  • one
    Sometimes technicians of the national school completely lack the ability to clearly express thoughts - skegg
  • There is such a book, Abrahamian 1001 tasks, and so it is easy to solve, matrices, arrays, etc. But what is given above is the arch-incomprehensible. - Goldy

1 answer 1

The task is really not formulated in great detail, but, in principle, it is possible to guess.

  • The bit string is not the most successful tracing from the widely used term bitfield . For more understanding, I recommend to get acquainted with this reference here and, for example, with std :: bitset.

  • Determine whether you have questions in general setting of the assignment, and if so, it is necessary to deal with each item separately.

  • Determine the class of the specified type.
  • Write defined as user-friendly functions of the keyboard input and display routine of data defining objects of this class.
  • Overload the specified operations and functions with the help of complex class functions.
  • Define constructors and destructor.

Now a little more about the operations that you need to implement (in addition to the operator<< and operator>> , implicitly indicated in paragraph 2 of the previous part).

  • <, > ==

Here, obviously, you are asked to enter some strict ordering on a set of bit strings. The task is poorly formulated, since you can come up with a sufficient number of such relationships and they are not reflected in the text of the task. It is possible that (taking into account the next part of the task) it is enough just to implement a comparison of the corresponding numbers.

  • long abs() - "value of the number specified by the bit string"

Presumably, here you need to get a number that is in its binary form and written in your string. That is, say, the bit string 11001 will correspond to the number 25 .

  • Oh thanks! But do not tell me why MVS C ++ 6.0 swears at randomize () and random () designates as an undeclared variable. - Goldy
  • Because rand() :) - Costantino Rupert
  • Replaced with rand () and displays that the functions have no parameters. I wanted to lay out what happened, the encoding does not allow. - Goldy
  • one
    @gold My intuition tells me that with the implementation of all points of this assignment you will have quite good troubles)) - Costantino Rupert
  • I wrote the code, but I don’t know how to lay it out, I need to change it a bit) Yes, of course there are troubles, the teacher will suffer from the number of questions ... - Goldy