eyvallah hocam çok saol bunlar işimi görur herhalde birde internette java için hazır kod bulabilirmiyim (ödev verilince direk ordan bulsam yani kendim yazmakla uğraşmasam)
We are going to extend the functionality of the Counter class discussed in the lectures.
Give Counter a new method called decrementCount that decreases by one the current count of the Counter. Give Counter a new constructor that takes as argument an existing Counter and initializes the count of the new counter being created with the current count of the Counter supplied as an argument. Give Counter a new method called add that takes as argument another Counter that adds to this counter's count the count value of the argument Counter. Give Counter a new method called repeat that changes the count by the same amount that the last method that incremented or decremented the counter did. For example, if the last change was +1, from an incrementCount, +1 is added again to the count. If the last change was -1, from a decrementCount, -1 is added again to the count. If the last change was a different value, as the result of an add call, that change should be applied again to the count. If the count has just been reset, repeat should just not change the count from its initial value of 0. To make this work, Counter must be given an additional piece of state to remember the last change. Here are some DrJava interactions with the class
bir de bu var
Beginning Programming with Java For Dummies(tıkla)
başka istersen söyle...
< Bu mesaj bu kişi tarafından değiştirildi Finney -- 16 Eylül 2005, 0:41:30 >
Bu mesaja 1 cevap geldi. Cevapları Gizle
bunlar işimi görur herhalde
birde internette java için hazır kod bulabilirmiyim (ödev verilince direk ordan bulsam yani kendim yazmakla uğraşmasam)
Bu mesaja 1 cevap geldi. Cevapları Gizle
burada da online dersler var. ayrıca örnek programlarda var.
Bu mesaja 1 cevap geldi. Cevapları Gizle
We are going to extend the functionality of the Counter class discussed in the lectures.
Give Counter a new method called decrementCount that decreases by one the current count of the Counter.
Give Counter a new constructor that takes as argument an existing Counter and initializes the count of the new counter being created with the current count of the Counter supplied as an argument.
Give Counter a new method called add that takes as argument another Counter that adds to this counter's count the count value of the argument Counter.
Give Counter a new method called repeat that changes the count by the same amount that the last method that incremented or decremented the counter did. For example, if the last change was +1, from an incrementCount, +1 is added again to the count. If the last change was -1, from a decrementCount, -1 is added again to the count. If the last change was a different value, as the result of an add call, that change should be applied again to the count. If the count has just been reset, repeat should just not change the count from its initial value of 0. To make this work, Counter must be given an additional piece of state to remember the last change.
Here are some DrJava interactions with the class
> Counter c1 = new Counter();> c1.incrementCount();> c1.currentCount()1> c1.incrementCount();> c1.currentCount()2> c1.decrementCount();> c1.currentCount()1> Counter c2 = new Counter(c1);> c2.currentCount()1> c2.add(c1);> c2.currentCount()2> c2.repeat();> c2.currentCount()3> c2.add(c2);> c2.currentCount()6> c2.repeat();> c2.currentCount()9