At the end of this lesson, you will be able to:
create a program that does basic math
review basic programs on Micro:bit
the entire point of creating electronic computers was to automate doing math, so let's get the Micro:bit to do simple math for us
add
subtract
multiply
divide
exponent
go over ASCII
if you happen to know "Unicode" characters, the Micro:bit can only show ASCII characters!
basically, no special characters, only the onse you see on the keyboard
see "Basic Math" program
see MakeCode Micro:bit below: ↓
go over "types" in TypeScript
why we need .toString()
click on provided link to create a new GitHub repo
call the repo: TEJ2O.1-Unit2-03
create a program that will do the following:
that calculates the area and perimeter of a rectangle with dimensions 5 cm & 3 cm, (see screenshot below: ↓)
hint: a = l x w or a = 5x3 and p = 2(l + w) or p = 2(5 + 3)
REMEMBER: to use everything we learned so far
proper style and formatting
ENSURE your units are done correctly (space between value and units: 15 cm^2)
do the above assignment but in Python
Output:
A rectangle has dimensions 5 cm & 3 cm.
The perimeter would be: 16 cm.
The area would be: 15 cm^2.