This site requires JavaScript, please enable it in your browser!
Greenfoot back
mkirkendall
mkirkendall wrote ...

2016/11/17

Little Crab Ch 4.7

mkirkendall mkirkendall

2016/11/17

#
Hi, I'm trying to finish up my crab game and am currently on chapter 4 exercise 7, which says: " Declare a variable called children (of type int).Then write an assignment statement that assigns to this variable the sum of two other variables named daughters and sons." for this I wrote: int children; so far, and I've tried writing: int children; int sum=daughters+sons; and int children; int sum=daughters+sons Can anyone please help me out with this?
Super_Hippo Super_Hippo

2016/11/17

#
It says "to this variable" so I guess there isn't a 'sum' variable. You just use children=daughters+sons as this "assignment statement".
You need to login to post a reply.