At the end of this lesson, you will be able to:
create a program that accepts user input
computers can do math, but what if we want to get some input from the user
go over what a variable is:
in math class
a value stored in the computer's memory that can be accessed by a name
before we can use it, we need to give it a name so we can refer to it
unlike math class, we DO NOT use single letters
we use word(s) that describe what is being held
ex. enterButton, firstName, ...
see "Different Naming Conventions" below: ↓
in TS what is var, let and const:
go over the Dice program
see below: ↓
click on provided link to create a new GitHub repo
call the repo: TEJ2O.1-Unit2-04
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
REMEMBER: to use everything we learned so far
proper style and formatting
ENSURE your units are done correctly (space between value and units: 15 C)
do the above assignment but in Python
areaOfTriangle
average
numberOfStudents
area_of_triangle
average
number_of_students
AreaOfTriangle
Average
NumberOfStudents
area-of-triangle
average
number-of-students
areaoftriangle
average
numberofstudents
AREAOFTRIANGLE
AVERAGE
NUMBEROFSTUDENTS
Click the "A" button to randomly generate a number between 1 and 6
Click the "A" button to run the program.
Output:
The temperature is: 25 C.