In the section practice for While Loop, there is the current card exercise as below:
and it prints something like this (everytime different, but always ends with ‘spade’). I thought that the point of this loop is “not printing the ‘spade’”? I understand it stops when it hits spade, but i thought it shall not print out ‘spade’? or if not, in what way i can code it in a way not printing the ‘spade’ (but still using the same logic as it stops while it hits ‘spade’)? Sorry i hope i made myself clear. Thanks!!
diamond
diamond
heart
diamond
heart
heart
club
club
diamond
club
club
club
heart
spade
And at the Do While look exercise:
within the bracket, instead of ‘cupsAdded ++’, can i use ‘cupsAdded = cupsAdded ++’, and what’s the difference? Thanks!!