Exercises
-
9.3 (Scope Resolution Operator) What’s the purpose of the scope resolution operator?
-
9.4 (Enhancing Class
Time
) Provide a constructor that’s capable of using the current time from thetime
andlocaltime
functions—declared in the C++ Standard Library header<ctime>
—to initialize an object of theTime
class. For descriptions of C++ Standard Library headers, classes and functions, seehttp://cppreference.com
. -
9.5 (
Complex
Class) Create a class calledComplex
for performing arithmetic with complex numbers. Write a program to test your class. Complex numbers have the formrealPart + imaginaryPart * i
where i is
Use
double
variables to represent theprivate
data of the class. Provide a constructor that enables an object ...
Get C++ How to Program, 10/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.