Lab 04A - I'm Bored
Overview
In this assignment you'll use the ACM libraries to generate a what to do when you're bored program.
Assignment
Write a DialogProgram
that will help the user find something to do by asking them a series of three questions. The answer to each question should control the set of questions they see, as well as the final answer.
Here are a couple of example question series:
Example 1:
----
Are you at home? TRUE
Do you have a phone? FALSE
Are you hungry? TRUE
----
YOU SHOULD ORDER PIZZA AND INVITE SOME FRIENDS OVER TO PLAY GAMES!
Example 2:
----
Are you at home? FALSE
Are you at school? TRUE
Do you have any homework to do? FALSE
----
YOU SHOULD GO TO THE LIBRARY AND READ A GOOD BOOK!
Note that the program in this example always starts with the same initial question, but it's subsequent questions depend on the answers to the previous runs.
Hints
-
You can use the
readBoolean("QUESTION HERE")
function to display a question dialog to the user. -
You can have any code within an
if
orelse
block, including anotherif
statement:
if(thisThing && thatThing) {
if(thisOtherThing) {
// ... This, that and the other are true
}
else {
// ... Only this and that are true
}
}
else {
// This isn't true, or that isn't true
}
Submission
To submit your assignment, follow the instructions for code submission.