Class Notes (835,539)
Canada (509,225)
York University (35,236)
ITEC 1620 (35)
Lecture

DesigningIfsTutorial.pdf

2 Pages
81 Views
Unlock Document

Department
Information Technology
Course
ITEC 1620
Professor
Stephen Chen
Semester
Fall

Description
Sample 1: A farmer needs to transport a wolf, a rabb it, and a bundle of cabbage across a river. However, he cannot carry all of the items in his boat at one time. Thus, he will have to make multiple trips across the river. With each trip, he might have to leave part of his cargo on the shore unattended. If left unattended together, the wolf will eat the rabbit, and the rabbit will eat the cabbage. In a JAVA program, there are three boolean variables – wolf, rabbit, and cabbage. The value of each variable is true if that item is unattended on the shore, and false otherwise. Write an if statement that will set the boolean variable safe to true if unattended items will be safe, and to false if one of
More Less

Related notes for ITEC 1620

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit