Microsoft ® Small Basic. The Math Object. Estimated time to complete this lesson: 1 hour. The Math Object. In this lesson, you will learn how to:. Use different operations of the Math object. Use different properties of the Math object. The Math Object.
Microsoft® Small Basic
The Math Object
Estimated time to complete this lesson: 1 hour
In this lesson, you will learn how to:
The Math object offers many mathematical functions that you can use in your programs.
Do complex mathematical calculations boggle your mind at times? Don’t worry!
Let’s learn about some operations of the Math object by writing a simple program.
Let’s use this property to calculate the area of the circle.
Let’s see how you can use this operation in a program to calculate a student’s average grade.
In this example, you use the Log operation to get the log value of 22.3.
The Math object in Small Basic offers the Log operation to get the log value of the specified number.
Let’s use this operation in a program.
Let’s apply this operation in a program.
In this program, you want to verify whether a specified number is even or odd.
You use the If condition to verify whether the number is even (that is, whether the remainder is 0 when you divide the number by 2). If the remainder is 1, the number is odd. To check the remainder, you use the Remainder operation of the Math object.
Congratulations! Now you know how to: