星期五, 3月 27, 2009

Homework 3-30-2009: counter

Define a class called Counter whose objects count things. An object of this class records a count that is a nonnegative integer. Include methods to set the counter to 0, to increase the count by 1, and to decrease the count by 1. Include an accessor method that returns the current count value and a method that outputs the count to the screen. Write a program to test


counter.reset();
counter.inc();
counter.inc();
counter.dec();
counter.output();

28 則留言:

Unknown 提到...

9427208 資工四乙 黃崇傑

匿名 提到...

資工四乙 9427203 葉家豪

匿名 提到...

9626315 電子二丙 陳子傑

匿名 提到...

9626320電子二丙林共兼

匿名 提到...

9528231 電機三乙 吳舒旻

匿名 提到...

電子二乙9626215廖姿雅

匿名 提到...

電子三甲 9526136 吳哲維

匿名 提到...

黃士誠 9626325電子二丙

匿名 提到...

電子二甲 9626126 王柏仁

匿名 提到...

電子二丙 9626351 許哲銘

匿名 提到...

電子三乙 王介君 9526203

匿名 提到...

電子三甲 9526118 陳詠敬

匿名 提到...

9626260 郭家源 電子二乙

大Q 提到...

電子二甲 9522154 周怡君

dale 提到...

9626358 電子2丙 陳柏瑞

s9526134 提到...

電子三甲 9526134 李政洵

匿名 提到...

電子二丙 9626302 王竣右

迪西 提到...
作者已經移除這則留言。
匿名 提到...

電子二丙 9626366 楊景文

匿名 提到...

電子三乙 9526239 王聖傑

鮪魚 提到...

電子二丙9626360陳威宇

匿名 提到...

電子四丙梁翰剛

匿名 提到...

電子三丙 9526357 施柏羽

匿名 提到...

電子二乙 9626203 鄭曜鐘

匿名 提到...

電子三乙 9526242 陳柏瑞

匿名 提到...

電子二甲 9626101 沈建志

test 提到...

電子三乙 9526215 吳國志

Ilikepie 提到...

電子三甲 9526155 胡國治