C++ Programming Ch.3 Exercise 8 Solution
Problem: int ํ์ ์ ์ ์๋ฅผ ๊ฐ์ฒดํํ Integer ํด๋์ค๋ฅผ ์์ฑํ๋ผ. Integer์ ๋ชจ๋ ๋ฉค๋ฒ ํจ์๋ฅผ ์๋ ์ธ๋ผ์ธ์ผ๋ก ์์ฑํ๋ผ. Integer ํด๋์ค๋ฅผ ํ์ฉํ๋ ์ฝ๋๋ ๋ค์๊ณผ ๊ฐ๋ค. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #include #include using namespace std; int main() { Integer n(30); cout << n.get() << ' '; // 30 ์ถ๋ ฅ n.set(50); cout << n.get() << ' '; // 50 ์ถ๋ ฅ Integer m("300"); cout << m.get() << ' '; // 300 ์ถ๋ ฅ cout << m.isEven(); // true(์ ์๋ก 1) ์ถ๋ ฅ } Objective & Hints: ...