| 18 | \*****************************************************************/ |
| 19 | |
| 20 | int main() |
| 21 | { |
| 22 | std::cout << "Create i with the value 0." << std::endl; |
| 23 | Integer i; |
| 24 | i.show(); |
| 25 | std::cout << "Change value of i to 15." << std::endl; |
| 26 | i.setValue(15); |
| 27 | i.show(); |
| 28 | |
| 29 | std::cout << "Create j from object i." << std::endl; |
| 30 | Integer j {i}; |
| 31 | j.show(); |
| 32 | std::cout << "Set value of j to 150 times that of i." << std::endl; |
| 33 | j.setValue(150 * i.getValue()); |
| 34 | j.show(); |
| 35 | |
| 36 | std::cout << "Create k with the value 789." << std::endl; |
| 37 | Integer k {789}; |
| 38 | k.show(); |
| 39 | std::cout << "Set value of k to sum of i and j values." << std::endl; |
| 40 | k.setValue(i.getValue() + j.getValue()); |
| 41 | k.show(); |
| 42 | |
| 43 | std::cout << "Result of comparing i and j is " << i.compare(j) << std::endl; |
| 44 | std::cout << "Result of comparing k and j is " << k.compare(j) << std::endl; |
| 45 | } |