Skip to content

A console-based calculator in Go, enabling basic arithmetic operations (addition, subtraction, multiplication, division) on two numbers. Features include user input validation and error handling for scenarios like division by zero, showcasing fundamental Go programming skills.

License

Notifications You must be signed in to change notification settings

ChinJingJie/SimpleCalc_Go_Lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleCalc_Go_Lang

This application implements a simple command-line calculator in Go. It allows users to perform basic arithmetic operations (+, -, *, /) on two numbers.

Features

  • Input Validation: Validates user input for numbers and operators to ensure calculations are performed accurately.
  • Basic Operations: Supports addition, subtraction, multiplication, and division.
  • Interactive Interface: Uses command-line interface (CLI) with prompts to guide users through operations.

Flowchart

SimpleCalc_Flowchart

Usage

Installation:

  • Clone the repository.
  • Ensure Go is installed on your machine.
  • Go version used for development: go1.22.5 darwin/amd64

Running the Application:

  • Navigate to the project directory.
  • Run go run calc.go.

Operations:

  • Follow on-screen prompts to enter numbers and select operators.
  • Confirm to proceed with calculations.
  • Option to reset or exit the calculator.

Testing

  • Unit testing is recommended to ensure each function and method behaves as expected. Example test cases can be found in calc_test.go.
  • Run go test.

Contributing

  • Contributions are welcome! Fork the repository and submit a pull request with your enhancements.
  • Report bugs or suggest features by opening an issue.

License

This project is licensed under the MIT License. See the LICENSE.txt file for details.

About

A console-based calculator in Go, enabling basic arithmetic operations (addition, subtraction, multiplication, division) on two numbers. Features include user input validation and error handling for scenarios like division by zero, showcasing fundamental Go programming skills.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages