Chapter 9
- What does the floor function do?
Return the next lowest whole number.
- What is the ABS of -3?
3
- What is the
ATAN
function?Inverse of the
TAN
function. - How would you write a program that can calculate a quadratic equation?
PROGRAM PLC_PRG VAR a : INT; b : INT; c : INT; root1 : REAL; root2 : REAL; END_VAR root1 := ((-1 * b) + SQRT(EXPT(b,2) - (4*a*c))) / (2*a); root2 := ((-1 * b) - SQRT(EXPT(b,2) - (4*a*c))) / (2*a);
- How would you write a program that can calculate 4 to the power of 3?
EXPT(4,3)
- What is the order of operations for a program?
Parentheses, exponents, multiplication, division, addition, and subtraction.
- What is the assignment operator?
:=