Thread: Class help
View Single Post
  #2 (permalink)  
Old 11-14-2007, 06:05 AM
JT4NK3D's Avatar
JT4NK3D JT4NK3D is offline
Member
 
Join Date: Nov 2007
Posts: 50
JT4NK3D is on a distinguished road
The correct return statement would be return accountbalance + amount;
alternatively i think you could either declare a new variable and assign accountbalance + amount, or you could initialize accountbalance to be accountbalance + amount and return that ( use shorthand accountbalance += amount, shorthand for accountbalance = acountbalance + amount)

personally, i'd stick with return accountbalance + amount.

hope that helped
Reply With Quote