Unit 4 Project: Binary Converter

Unit 4 Project

This is an individual project. This means that all of your work must be your own, indisputable work. If you need help on something, you may ask other people for help, however, the scripts that you create must be your own work. If there’s any convincing evidence that the work that you submit is not your own, you will recieve an automatic 0 on this project and any participation grade related to working on the project.

In this project, you will create a program that converts binary numbers made up of 7 bits into decimal.

The user will be given seven bits that begin by displaying 0. If the user clicks on one, it will change to 1. If it’s 1 and the user clicks on it, it should change back to 0.

When the user presses the ‘calculate decimal value’ button, the Decimal Value sprite will display the decimal equivalent of the number currently shown in binary across the seven bits. You may also opt to have the Decimal Value sprite update itself automatically every time a binary digit is changed. This choice is up to you. Neither approach is particularly more or less difficult than the other.

When the user presses the ‘reset’ button, all the bits will return to display 0, as will the Decimal Value sprite.

Click for a suggestion of how to organize the different stages of the program.

  1. Green flag creates clones for the digits.
  2. Each digit has ‘when I am clicked’, costume should toggle between 0 and 1.
  3. How should the decimal value display be updated when a digit is changed?
  4. What happens when the user presses the reset button?

Click here to load this file. Then save it to your Snap! account.

  1. Add a “+1” button that will add one to the digits when you press it.
  2. Make a version of the program that will keep track of numbers in a base other than 2 (try base 16, called ‘hexidecimal’, also used in computer science)