| 3 | import integer; |
| 4 | |
| 5 | int main() |
| 6 | { |
| 7 | std::cout << "Create i with the value 10." << std::endl; |
| 8 | Integer i {10}; |
| 9 | i.show(); |
| 10 | std::cout << "Change value of i to 15." << std::endl; |
| 11 | i.setValue(15); |
| 12 | i.show(); |
| 13 | |
| 14 | std::cout << "Create j from object i." << std::endl; |
| 15 | Integer j {i}; |
| 16 | j.show(); |
| 17 | std::cout << "Set value of j to 150 times that of i." << std::endl; |
| 18 | j.setValue(150 * i.getValue()); |
| 19 | j.show(); |
| 20 | |
| 21 | std::cout << "Create k with the value 789." << std::endl; |
| 22 | Integer k {789}; |
| 23 | k.show(); |
| 24 | std::cout << "Set value of k to sum of i and j values." << std::endl; |
| 25 | k.setValue(i.getValue() + j.getValue()); |
| 26 | k.show(); |
| 27 | |
| 28 | std::cout << "Result of comparing i and j is " << compare(i, j) << std::endl; |
| 29 | std::cout << "Result of comparing k and j is " << compare(k, j) << std::endl; |
| 30 | } |