1. Engineering
  2. Computer Science
  3. please help and include comments ive been a little confused...

Question: please help and include comments ive been a little confused...

Question details

Please help and include comments, I've been a little confused. (this is in C++)

Create a class called clockType for a clock type with fields hr, min, and sec. Your code should support the following set of statements 1 clockType c1; 2 clockType c2 (10,59); 3 clockType c3(5,10,20); 4 int sec = 10; 5 cout << c1; cout << c1+c2; In c2, you only set hr and min fields. Note that the min and sec fields can only support numbers in the range 0 to 60.

Discuss the following questions: 1. What constructors did you need to use? Is one constructor enough? 2. What is the difference between lines 5 and 6? Do you need special implementation to suppornt line 6? 3. Do you need to overload the assignment operator to support any the above operations? 4. What did you need to do to support line 8? What would happen if you tried cout << secc1 instead?

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution