Class ProAndCon

java.lang.Object
org.jacop.examples.fd.ExampleFD
org.jacop.examples.fd.ProAndCon

public class ProAndCon extends ExampleFD
It solves a simple logic puzzle about voting city council.
Version:
4.9

Logic Puzzle - Pro and Con Author: Monica Tenniel Publication: Dell Logic Puzzles Issue: April, 1998 Page: 12 Stars: 2 At the last meeting of the local city council, each member (Mr. Akerman, Ms. Baird, Mr. Chatham, Ms. Duval, and Mr. Etting) had to vote on five motions, number 1 to 5 in the clues below. Can you discover how each one voted on each motion?

Note: a motion may have received zero or one yes vote, even though in real life it's unlikely that both the maker and seconder of the motion would change their minds before the motion came up for a vote. Each member voted either yes or no on each motion; no one abstained from voting on any motion.

Voting Chart (view with non-proportional fonts)

1 2 3 4 5 Mr. Akerman Ms. Baird Mr. Chatham Ms. Duval Mr. Etting

1. Each motion got a different number of yes votes. 2. In all, the five motions got three more yes votes than no votes. 3. No two council members voted the same way on all five motions. 4. The two women disagreed in their voting more often than they agreed. 5. Mr. Chatham never made two yes votes on consecutive motions. 6. Mr. Akerman and Ms. Baird both voted in favor of motion 4. 7. Motion 1 received two more yes votes than motion 2 did. 8. Motion 3 received twice as many yes votes as motion 4 did.

Determine: fill in the chart (Yes/No) for each motion

  • Constructor Details

    • ProAndCon

      public ProAndCon()
  • Method Details

    • model

      public void model()
      Description copied from class: ExampleFD
      It specifies a standard way of modeling the problem.
      Specified by:
      model in class ExampleFD
    • main

      public static void main(String[] args)
      It executes the program which solves this logic puzzle.
      Parameters:
      args - command arguments (none here)