Alice Community  

Go Back   Alice Community > General Discussion > The Lounge

Reply
 
Thread Tools Display Modes
Assign5 - SB
Old
SBrooks84591
Junior Member
 
Status: Offline
Posts: 6
Join Date: Aug 2014
Default Assign5 - SB - 10-06-2014, 09:54 PM

I was able to complete the assignment and have the objects say the right phrases after the user enters the number. However, I used three If/Else statements. Did anyone come up with a quicker or easier way to do this?

Thanks,
stephanie B.
   
Reply With Quote
Old
relliott44444
Junior Member
 
Status: Offline
Posts: 11
Join Date: Sep 2014
Default 10-08-2014, 01:27 PM

Hello,

I noticed that it you said it took you 3 statements. Try the approach of a condition table to help see the possibilities for if/else logic. That is good to scrutinize yourself as our programming only gets more complex.

Richard
   
Reply With Quote
Another Possibility
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default Another Possibility - 10-08-2014, 02:31 PM

Examine the "World" functions Tab and experiment with the two String functions.
   
Reply With Quote
Old
thien
Junior Member
 
Status: Offline
Posts: 8
Join Date: Aug 2014
Default 10-14-2014, 05:32 AM

Hi Stephanie,

I use nested if/else statements instead

if(age = 1)
bouncer say welcome
else{
if(age > 21)
bouncer say too old
else
bouncer say too young
}
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.