Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dart Basic CLI Calculator

    __  ___      ______      ________      __      __
   /  |/  /_  __/ ____/___ _/ / ____/_  __/ /___ _/ /_____  _____
  / /|_/ / / / / /   / __ `/ / /   / / / / / __ `/ __/ __ / ___/
 / /  / / /_/ / /___/ /_/ / / /___/ /_/ / / /_/ / /_/ /_/ / /
/_/  /_/__, /____/__,_/_/____/__,_/_/__,_/__/____/_/
       /____/                        https://msuport.vercel.app

Overview

This is a simple CLI-based calculator written in Dart. It allows users to perform basic arithmetic operations interactively through the command line.

Features

  • Supports addition (+), subtraction (-), multiplication (*), and division (/)
  • Handles invalid inputs and prevents division by zero
  • Runs in a loop allowing multiple calculations until the user chooses to exit

Usage

  1. Run the script using Dart:
    dart cli_calculator.dart
  2. Follow the prompts to enter numbers and an operator.
  3. View the calculated result.
  4. Choose to continue or exit.

Example

    __  ___      ______      ________      __      __
   /  |/  /_  __/ ____/___ _/ / ____/_  __/ /___ _/ /_____  _____
  / /|_/ / / / / /   / __ `/ / /   / / / / / __ `/ __/ __ / ___/
 / /  / / /_/ / /___/ /_/ / / /___/ /_/ / / /_/ / /_/ /_/ / /
/_/  /_/__, /____/__,_/_/____/__,_/_/__,_/__/____/_/
       /____/                        https://msuport.vercel.app


Simple Calculator
Enter first number:
12
Enter an operator (+, -, *, /):
+
Enter second number:
45
Result: 12.0 + 45.0 = 57.0
Do you want to perform another calculation? (yes/no)
yes

Author

Muhammad Sudais Usmani
🌐 msuport.vercel.app

About

DartCal is a simple CLI-based calculator written in Dart for performing basic arithmetic operations. It supports addition, subtraction, multiplication, and division, with input validation and division-by-zero handling.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages