Home » Unit 6: Exercise: Snap! project: Vote on a Bill

Snap! project: Vote on a Bill

🗳️ Snap! Project: Proposal Voting and Movement

In this exercise, you’ll build upon your previous project and add new functionality! You'll be working with If-Else statementsarrow key controls, and global variables to create an interactive proposal voting system.

🛠️ What to Do:

  1. Open the Project: Begin by opening the Snap! project where you’ll continue your work from the previous exercise:

    🔗 Unit 06: Proposal Voting and Movement

  2. Tasks:

    • Add movement: Program the 'Proposal' object to be moved using the arrow keys.

    • Trigger voting: Modify the 'Parliament' and 'Council' objects so the vote is triggered when the 'Proposal' object comes into contact with them (instead of being triggered by clicking).

    • Global variable: Store the voting decision in a global variable that can be accessed by the proposal object.

    • Space bar action: When the space bar is pressed, the proposal object should announce whether the proposal has been approvedrejected, or if no decision has been made yet.

🔍 Need Help?

If you're stuck or want to check your work, you can view the solution here:

🔗 Solution: Unit 06 Proposal Voting and Movement

Feedback

We appreciate your feedback! It helps us continuously improve our course materials.