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 |
星期一, 12月 11, 2006
隨堂上機考 (1)
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言