Binary number converter
Objectives
- Get really comfortable with variables
Assignment
- Create a clean program that will read a binary number (black = 1, white = 0) and display the equivalent number (in decimal) on the screen. Your robot should stop when it encounters any color other than black or white. Keep the length short.
- Each digit will be about one inch square. There is nothing special separating the colors
Suggestions
-
- Start playing two different notes as the robot moves along, one note for black and a different note for white. Make sure these notes are very short duration. End when it encounters another color.
- Start the variable out as 1, multiply it by 2 for each new inch, display the final number. It should be a power of 2!
- Then conditionally add one after the multiplier if it is black.
Submission instructions
- Due date is found on Canvas
- Each person should create a pdf document that contains the following information
- Your name
- Your partner's name
- A brief description of what you did
- A brief description of what your partner did
- How your team improved over any mistakes made last time
- Indicate which hints (if any) your team used
- How well you achieve each objective.
- Submission:
- Team member A submits the team's code and his/her pdf document in one zip folder.
- Team member B submits his/her pdf document (does not need to be zip'ed)
Hints
Challenges
- Have the robot speak the final number
- Let the user work in octal or binary (based on the button on the block that is clicked).
This topic: CenterForComputing
> WebHome >
SyllabiSpring2025 >
CSC102SylS2025 > CSC102S2025Lab9
Topic revision: r2 - 2026-07-09 - CathyBareiss