Skip to main content

2.1) Declarations


It is important in your program to distinguish the types of variables you are using. You should always decide what type of variables based on what you are calculating in your program. In the program involved in the solution of Exercise 1 (watch the video solution) the variables were real numbers because temperature can take on values with decimal places like 30.5 C, etc. So we wouldn’t want to restrict the variables to be integer numbers, for example.