tag:blogger.com,1999:blog-18677687.post4951012076508726109..comments2024-03-27T15:13:24.764-04:00Comments on Computer Science Teacher: If Statement Programming ProjectsAlfred Thompsonhttp://www.blogger.com/profile/05575057876858763822noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-18677687.post-58093050664569082002019-09-28T21:38:56.308-04:002019-09-28T21:38:56.308-04:00I've used the Ski Lift Ticket problem you ment...I've used the Ski Lift Ticket problem you mention. Another similar challenge that students enjoy is Cay Horstmann's "Minivan Locks" problem: <br /><br />A minivan has two sliding doors, and each door can be opened by either a dashboard switch, its inside handle, or its outside handle. The inside handles won't work if a child lock switch is activated, and in order for the sliding doors to open, the gear shift must be in park and the master unlock switch must be activated. Given an input that is a sequence of values for the switches and the gear shift, identify if the left door only is unlocked, the right door only is unlocked, both doors are unlocked, or both doors are locked. Sample input would be <br /><br /> 0 0 0 1 0 1 0 0 P<br /><br />where those nine values represent respectively:<br /><br />* Dashboard switches for left and right sliding door, child lock, and master unlock (0 for off or 1 for activated)<br />* Inside and outside handles on the left sliding door (0 or 1)<br />* Inside and outside handles on the right sliding door (0 or 1)<br />* The gear shift setting (one of P N D 1 2 3 R). <br /><br />Classic!Richard Whitehttps://www.blogger.com/profile/12946629948772268121noreply@blogger.comtag:blogger.com,1999:blog-18677687.post-33789796579385464922019-09-26T11:49:01.002-04:002019-09-26T11:49:01.002-04:00A couple of decades ago (boy does that sound old) ...A couple of decades ago (boy does that sound old) I used to have the kids write a text D&D game that was all nested "if" statements. The basic concept was to work through a maze and collect jewels. A bit long and tedious for now but still could be fun with the right approach. If I remember right it was arrays for the maze.Garthnoreply@blogger.comtag:blogger.com,1999:blog-18677687.post-25370909089842415922019-09-26T08:46:51.871-04:002019-09-26T08:46:51.871-04:00I love the idea of text adventures. Choose your ow...I love the idea of text adventures. Choose your own story path are fun as well and I had a student do a mini version of one recently.<br /><br />I'm thinking about a version of the Evan Peck project for my students. I am thinking about allocation of parking permits (a highly valued limited edition in my school). Possibly some interesting conversations.Alfred Thompsonhttps://www.blogger.com/profile/08860483284747770757noreply@blogger.comtag:blogger.com,1999:blog-18677687.post-8335901050647248532019-09-25T18:59:43.690-04:002019-09-25T18:59:43.690-04:00if (room == "foyer"):
if (action == &q...if (room == "foyer"):<br /> if (action == "back"): <br /> room == "outside"<br /> elif (action == "forward"): <br /> room == "hall"<br /><br />Write text adventure games, which let students choose a domain that interests them. Also a good way to motivate refactoring later in the course as they learn about other programming language elements.Clifhttps://www.blogger.com/profile/11298806845816789809noreply@blogger.comtag:blogger.com,1999:blog-18677687.post-70355216518682751072019-09-25T17:52:05.189-04:002019-09-25T17:52:05.189-04:00Just wrote a post with one (and I planned on writi...Just wrote a post with one (and I planned on writing it before I saw this :-) ).<br />Mike Zamanskyhttps://www.blogger.com/profile/15069276938781711576noreply@blogger.comtag:blogger.com,1999:blog-18677687.post-9257016621832342682019-09-25T14:16:42.813-04:002019-09-25T14:16:42.813-04:00Of course I can't find the tweet now, but I mo...Of course I can't find the tweet now, but I modified this assignment: https://docs.google.com/document/d/1HsRSC3H_u6KcQhv2y9cWyrYV3xpvvBUcAvoaH-FsG0I/edit from Evan Peck for my high school intro class this year and had some awesome discussion as a result.Michelehttps://www.blogger.com/profile/16733711766930528278noreply@blogger.com