MoonCampaign by Viren (7 years)
Our Social Impact - We're transforming education globally with free robotics and math workshops in the US, UK,
Canada, and Australia.
Our workshops have helped 66,000 students alone in the US plus 14,000 students benefit from our four-week sessions.
Calculator
Viren
Show and Tell
Show n Tell
Coming Soon
Viren’s Calculator project smartly uses a Micro:bit to create a simple calculator for young learners, accepting two numbers and an operation via input prompts. It performs addition, subtraction, multiplication, or division, displaying the result—or an error for division by zero or invalid operations—offering a practical and interactive way to explore coding and basic math operations.
Needing help with math homework one day got me thinking, so I decided to create my Calculator project with a Micro:bit to make adding and multiplying easier. I wanted to type in numbers and pick an operation to see the answer right away. It’s been fun learning how to use the Micro:bit to do math for me!
I started my code with a Micro:bit import and set it up to ask me for two numbers and an operation—like “+” or “*”—using input prompts. For example, I enter a first number like 5, then pick “+,” and a second number like 3. My code uses if-elif statements to check the operation: if it’s “+,” it adds them to get 8; if it’s “/” and the second number isn’t 0, it divides; but if I try dividing by zero, it says “Error (Division by Zero).” For anything else, it shows “Invalid Operation.” Then it prints the whole thing, like “The result of: 5 + 3 = 8,” so I can see it all.
I’m excited to make this calculator even better next time! Maybe I can add a button to start it instead of typing, or make the Micro:bit’s LEDs light up with the answer. I could also try adding more operations like squares. I’m happy I’m learning how to code math with my Micro:bit, and I can’t wait to show my friends how it helps with our homework!
©️ Copyright, Moonpreneur Inc.
691 S Milpitas Blvd, STE 217 Milpitas CA 95035, USA
Likes
Rating
42 days left
Calculator