At the end of this lesson, you will be able to:
create a program that accepts user input and does basic mathematical calculations
variables
we call "=" , "is assigned" not "equal"
some_var = some_var + 1
go over using variables and doing calculations
we know the computer can do basic math with numbers, now lets replace the numbers with variables
go over the "Light Percentage" program
see below: ↓
go over Math.round()
click on provided link to create a new GitHub repo
call the repo: TEJ2O.1-Unit2-05
create a program that will do the following:
when the user clicks the "A" button, the Micro:bit goes and gets the current temperature, saves it to a variable and then show the temperature to the user
the problem is we learned that the SI unit for temperature is K, not C
so convert the celsius temperature to kelvin
don't forget to round off, so there are no decimals!
REMEMBER: to use everything we learned so far
proper style and formatting
ENSURE your units are done correctly (space between value and units: 15 K)
do the above assignment but in Python
Click the "A" button to run program
Click the "A" button to run program
Output:
The temperature is: 294 K.