Passnownow

SS2 Computer Science Third Term: Basic Function and Basic Programming

Topic: Basic Function

A function is a structure that simplifies a complex operation into a single step. A function is therefore a many-to-one (or sometimes one-to-one) relation. The set of values at which a function is defined is called its domain, while the set of values that the function can produce is called its range. Functions act as ‘black boxes’, they accept input, value or values  and process them in a defined manner to produce or return an output value. As long as you know how and when to use a particular function, you need not to be bothered about how it actually works.

Consider, for example the process of taking the square root of a number value. If you have to define this program, anytime you need a square root, your program would require extra code and you would probably get tired of entering the same code over and over again.

True Basic has a built in function that compresses the entire square root operation into a single step. Using the SQR function, your program can easily find the square root of any number greater than or equal to zero.

BASIC Programming

In 1964, John G. Kemeny and Thomas E. Kurtz designed the original BASIC language at Dartmouth College in New Hampshire.

B – Beginners

A – All purpose

S – Symbolic

I – Instructional

C – Code

Basic Arithmetic Expressions

Basic arithmetic expressions and algebraic expressions are similar with little different examples of basic arithmetic expressions. Arithmetic expressions are composed of a combination of constants, variables, operation symbols, and functions. An expression may be very simple or quite complex, but it will result in a single value. Whether an expression is simple or complex, the calculations must be performed in a specific order. To ensure the computer will correctly evaluate and calculate arithmetic expressions, you have to learn to code them using the rules of BASIC. In order to use arithmetic expressions efficiently, you must be able to evaluate and convert conventional mathematical expressions into proper BASIC expressions.

Read more below-

SS2 Computer Science Third Term: Basic Function and Basic Programming

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top