Numeric Variables
in our previous section we talked about this AlphNumeric variable types. In this section we are going to talk about its counter part numeric Variables. Numeric variables give the us the opportunity to take data and use it mathematically. The four variables that we work with the most are
int, long, float and double
int - is a variable type that can store a large whole number.
The range for an in is -2147483648 to 2147483647.
You may notice that the positive number is one smaller than the negative number. The reason for this is that the computer recognizes 0 as a positive number.
long - is a variable type that can store a much larger whole number.
The range for an in is -9223372036854775808 to 944227203685477807.
You may notice that the positive number is one smaller than the negative number. Once again the reason for this is that the computer recognizes 0 as a positive number.
float - is a variable type that can store a number with a decimal point. The number that can be store in this variable type is pretty huge or pretty small. it depends on how many numbers you have following the decimal point instead of leading it.
The number that it can store is 3.4e to the power of -38 - to - 3.4e to the power of 38.
double - is a variable type that can store a number with a decimal point. The number that can be store in this variable type is pretty huge or pretty small. it depends on how many numbers you have following the decimal point instead of leading it.
The number that it can store is 1.7e to the power of -308 to 1.7e to the power of 308.
Very rarely do we ever need a number this large so we use floats most commonly
int, long, float and double
int - is a variable type that can store a large whole number.
The range for an in is -2147483648 to 2147483647.
You may notice that the positive number is one smaller than the negative number. The reason for this is that the computer recognizes 0 as a positive number.
long - is a variable type that can store a much larger whole number.
The range for an in is -9223372036854775808 to 944227203685477807.
You may notice that the positive number is one smaller than the negative number. Once again the reason for this is that the computer recognizes 0 as a positive number.
float - is a variable type that can store a number with a decimal point. The number that can be store in this variable type is pretty huge or pretty small. it depends on how many numbers you have following the decimal point instead of leading it.
The number that it can store is 3.4e to the power of -38 - to - 3.4e to the power of 38.
double - is a variable type that can store a number with a decimal point. The number that can be store in this variable type is pretty huge or pretty small. it depends on how many numbers you have following the decimal point instead of leading it.
The number that it can store is 1.7e to the power of -308 to 1.7e to the power of 308.
Very rarely do we ever need a number this large so we use floats most commonly
The Videos
Intro
Order of Operation and Operators
Modulo, Increment, Decrement
.NET Framework
The Assignment
Where do the numbers go?
Copy and paste the following block of PsuedoCode into Visual Studios.
1. Create variables for every line of PsuedoCode that needs one.
2. For other lines of PsuedoCode Print out what is contained in those variables to the console.
3. Use Concatenation to output correct lines of text to the Console, when needed.
4. Screen shot your code (including your name block) and your Console results
5. Turn both Screenshots into google Classroom
Copy and paste the following block of PsuedoCode into Visual Studios.
1. Create variables for every line of PsuedoCode that needs one.
2. For other lines of PsuedoCode Print out what is contained in those variables to the console.
3. Use Concatenation to output correct lines of text to the Console, when needed.
4. Screen shot your code (including your name block) and your Console results
5. Turn both Screenshots into google Classroom
Psuedocode
// First variable should contain this number 3.14 and be named Pi
// Second variable should contain the number 457 and be named Num1
// Third variable should contain the number 782 and be named Num2
// Fourth variable should contain the 25.5 and should be named building Height
// Write this message out to the console, The mathematical number of pi is (insert variable) we use it to figure out dimensions for a circle
// Write this message out to the console, If I have a circle that has a radius of (insert variable Num1) and we square it and multiply it by pi (insert variable Pi), we can find out what the are of that circle
// Write this message out to the console, The other two numbers that we can work with are (insert Num1) and (insert nNum2)
// Second variable should contain the number 457 and be named Num1
// Third variable should contain the number 782 and be named Num2
// Fourth variable should contain the 25.5 and should be named building Height
// Write this message out to the console, The mathematical number of pi is (insert variable) we use it to figure out dimensions for a circle
// Write this message out to the console, If I have a circle that has a radius of (insert variable Num1) and we square it and multiply it by pi (insert variable Pi), we can find out what the are of that circle
// Write this message out to the console, The other two numbers that we can work with are (insert Num1) and (insert nNum2)