Enhanced Calculator Program Documentation This calculator program supports a wide range of mathematical operations, including basic arithmetic, trigonometric functions, logarithmic functions, statistical calculations, and more. It also supports solving linear and quadratic equations, converting between degrees and radians, and matrix operations.
Basic Arithmetic : Addition, subtraction, multiplication, division, and exponentiation.Square Root Calculation :sqrt
for square root.Trigonometric Functions :sin
,cos
,tan
,asin
,acos
,atan
.Logarithmic Functions :log
for natural logarithm,log10
for base-10 logarithm.Factorial Calculation :factorial
for calculating the factorial of an integer.Modulo Operation :mod
for modulo operation.Prime Check :prime
for checking if a number is prime.Linear Equation Solving :eq
for solving linear equations of the formax + b = 0
.Quadratic Equation Solving :qeq
for solving quadratic equations of the formax^2 + bx + c = 0
.Degree-Radian Conversion :deg2rad
andrad2deg
.Statistical Calculations : Mean (mean
), median (median
), mode (mode
), standard deviation (stddev
).Matrix Operations :matrix
(not implemented yet).Memory Operations :mem
for saving and recalling values from memory.The program displays a menu with available operations. Enter the corresponding operation keyword or symbol to perform a specific operation. To exit the program, typeexit
. Basic Arithmetic and Expressions Supports expressions involving addition (+
), subtraction (-
), multiplication (*
), division (/
), and exponentiation (^
). Expressions can be entered directly and will be evaluated. Operation:sqrt
Enter a number to calculate its square root. Operations:sin
,cos
,tan
,asin
,acos
,atan
Enter the angle in radians to calculate the corresponding trigonometric value. Operations:log
(natural logarithm),log10
(base-10 logarithm) Enter a number to calculate its logarithm. Operation:factorial
Enter an integer to calculate its factorial. Operation:mod
Enter two integers to calculate the modulo (remainder) of their division. Operation:prime
Enter an integer to check if it is a prime number. Operation:eq
Enter the coefficientsa
andb
for the linear equationax + b = 0
to find the value ofx
. Quadratic Equation Solving Operation:qeq
Enter the coefficientsa
,b
, andc
for the quadratic equationax^2 + bx + c = 0
to find the roots. Operations:deg2rad
,rad2deg
Convert degrees to radians or radians to degrees by entering the value. Operations:mean
,median
,mode
,stddev
Enter the number of elements and their values to calculate the respective statistical measure. Operation:matrix
Matrix operations are not yet implemented. Operation:mem
Save a value to memory or recall a value from memory. > 3 + 4 * 2 / (1 - 5) ^ 2Result: 3.50
> sinEnter the angle (in radians): 1.5708Result: 1.00
> logEnter a number: 2.7183Result: 1.00
> factorialEnter an integer: 5Result: 120.00
> modEnter two integers: 10 3Result: 1.00
> primeEnter an integer: 7Result: 7 is a prime number.
> eqEnter coefficients a and b for ax + b = 0: 2 -4Result: 2.00
> qeqEnter coefficients a, b, and c for ax^2 + bx + c = 0: 1 -3 2Roots: 2.00 and 1.00
> deg2radEnter degrees: 180Radians: 3.14
The program handles both floating-point and integer inputs. Error messages are displayed for invalid operations or inputs, such as division by zero or invalid function names. Memory operations allow for saving and recalling values for later use. This documentation covers all features and usage scenarios for the enhanced calculator program. Feel free to modify and expand it as needed!