https://github.com/calculationcollective/gocalculator
Calculator in go
https://github.com/calculationcollective/gocalculator
calculator go
Last synced: 12 months ago
JSON representation
Calculator in go
- Host: GitHub
- URL: https://github.com/calculationcollective/gocalculator
- Owner: CalculationCollective
- License: other
- Created: 2023-01-19T16:43:43.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-20T09:27:42.000Z (about 3 years ago)
- Last Synced: 2025-01-08T16:08:00.972Z (about 1 year ago)
- Topics: calculator, go
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE.md
Awesome Lists containing this project
README
# GOCalculator
- [GOCalculator](#gocalculator)
- [Build the calculator](#build-the-calculator)
- [Use the calculator](#use-the-calculator)
## Build the calculator
You either can run the calculator with
```bash
go run calculator.go
```
or you can build it with this instruction.
First init the repo.
```bash
go mod init calculator
```
and build it after with
```bash
go build
```
Now we should have a file named `calculator`. To execute it type
```bash
./calculator
```
## Use the calculator
After executing the calculator you can enter the first number.
```bash
Enter first number: 5 # 5 is the input
```
Then choose between the calculation functions.
```bash
Choose between:
1)Addition
2)Subtraction
3)Multiplication
4)Division
1 # < This is our input
```
We now can enter the second number
```bash
Enter second number: 2 # 2 is the input
```
Now it should give the right output.
```bash
7 # 7 is the return value
```