English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

Initially, farmer, goat, grass, wolf = L, L, L, L, and the farmer crosses the river with a goat. Model the action with an assignment statement. - Computer Science

Advertisements
Advertisements

Question

Initially, farmer, goat, grass, wolf = L, L, L, L, and the farmer crosses the river with a goat. Model the action with an assignment statement.

Answer in Brief

Solution

  1. — farmer, goat,grass,wolf = L,L,L,L.
  2. Farmer,goat: = R,R
  3. – farmer,goat,grass,wolf = R,R,L,L
  4. – farmer: = L
  5. — farmer,goat,grass,wolf = L,R,L,L
  6. farmer,grass: = R,R
  7. — farmer,goat,grass,wolf = R,R,R,L
  8. farmer,goat: = L,L
  9. — farmer,goat,grass, wolf = L,L,R,L
  10. farmer, wolf: = R,R
  11. — farmer,goat,grass, wolf = R,L,R,R
  12. farmer: = L
  13. — farmer,goat,grass,wolf = L,L,R,R
  14. farmer, goat: = R,R
  15. — farmer,goat,grass,wolf = R,R,R,R
shaalaa.com
Abstraction
  Is there an error in this question or solution?
Chapter 6: Specification and Abstraction - Evaluation - Section - B [Page 86]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 11 TN Board
Chapter 6 Specification and Abstraction
Evaluation - Section - B | Q 3. | Page 86
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×