2008年11月7日 星期五

lab 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();

沒有留言:

張貼留言

C#小技巧

1.輸入mbox之後,再連續案兩次tab鍵,會自動產生messagebox.show("test");
2.區塊註解Ctrl + K + C, 區塊取消註解Ctrl + K + U