CS代写 Sample Midterm Questions:

Sample Midterm Questions:
Design a class for the concept of complex number. Each complex number has a real part and an imaginary part.
Overload operators +, -, *, / for this class. Overload the operator ++ and –.
In the prefix form of ++, the real part will be increased by 1, and in the postfix form, the imaginary part. Keep the priority of postfix and prefix operators.

Copyright By PowCoder代写 加微信 powcoder

In the prefix form of –, the real part will be decreased by 1, and in the postfix form, the imaginary part. Keep the priority of postfix and prefix operators.
Overload == and !=.
Design a class for string like the string of STL (Do not use the string of STL). We need a dynamic array of chars.
We need a default, user, and copy constructor.
The user constructor received an array of chars to initialize the string with. Overload operator [ ].
Overload operator >> for reading the string.
Overload operator << for printing the string. Overload operator + for both concatenation a string and a char. 程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com