-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInstructions.txt
More file actions
83 lines (67 loc) · 3.2 KB
/
Copy pathInstructions.txt
File metadata and controls
83 lines (67 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
(ENGLISH)
Welcome to CalculatorX
How it works:
-Just type your mathematical expression and press enter to get the result.
Ex: if you type "2 + 5" you will get 7.
CalculatorX supports addition(+), subraction(-), division(/) and
multiplication(*), powers(x^y).
You can use parentheses to modify the order of evaluation such that if
you type "2 * (2 + 1)" the result will be 6
VARIABLES
In addition to the basic operations, CalculatorX also supports
variables. You can do all the arithimetic operations with variables
Here is an example of how to use variables: "let x = 22".
This declares a variable named x that holds the value 22
If I want to modify the variable to hold the value 10 instead of 22,
I would simply type "x = 10"
CONSTANTS
To define a variable that cant be changed use the "const" keyword
before the name of the variable:
"let const lightSpeed = "3 * 10^8"
FUNCTIONS
Built in functions
sqrt(x) -> square root
You can define your own functions in CalculatorX. As an example,
here is how to declare a function that computes the double of a number:
"let double(x) = x * 2"
Functions can have zero or more than one argument, for exemple the
following function takes 2 parameters and computes their average:
"let average(x,y) = (x + y) / 2"
To call a function simply type the name of the function followed by
the arguments values. Using as an example the preceding function:
"average(5,7)" -> the result will be 6
To exit just type "exit" and press enter;
Github Repository for suggestions or bug report https://github.com/DavesBorges/CalculatorX
Happy Math time
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
(PORTUGUES)
Bem vindo ao CalculatorX
Como funciona:
-Escreva uma expressão matematica e prima ENTER para obter o resultado
Ex: Se digitares "2 + 5" iras obter 7.
CalculatorX supporta addicao(+), subtracao(-), divisao(/), multiplicacao(*) e potência(x^y)
Podes usar parenteses para modificar a ordem de operação de maneira que
se digitares "2 * (2+1)" o resultado sera 6
VARIAVEIS
Alem das operações basicas, CalculatorX tambem suporta variaveis. Podes
realizar todas as operações aritimeticas com variaveis.
Eis ume exemplo de como utilizar uma variavel:
"let x = 22".
Isto declara uma variavel chamada x que contém o valor 22
Se quiseres modificar a variável para que o seu valor seja 10 em vez de 22,
basta digitar "x = 10"
Funcoes
Funções predefinidas:
sqrt(x) -> raíz quadrada de x
Podes definir as tuas proprias funcoes no CalculatorX. Por exemplo, eis como
declarar uma funcao que calcula o dobro de um numero:
"let dobro(x) = x * 2"
Funcoes podem ter zero ou mais argumentos, por exemplo a função a seguir
tem dois argumentos e calcula a média dos argumentos passados:
"let dobro(x,y) = (x+y) / 2"
Para chamar uma funcao basta digitar o nome da funcao seguido pelos valores
dos argumentos. Usando como exemplo a função anterior:
"average(5,7) " -> o resultado será 6
Para sair da aplicacao basta digitar "exit" e pressionar ENTER
Repositorio do codigo para sugestoes ou reportar erros https://github.com/DavesBorges/CalculatorX
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>