Giter Club home page Giter Club logo

consolecalculator's Introduction

ConsoleCalculator

This is a simple C# console-based calculator application that allows users to perform basic arithmetic operations such as addition, subtraction, multiplication, and division. The program takes numeric inputs from the user, performs the selected operation, and provides the result. It includes error handling to ensure the user inputs only numeric values and does not attempt to divide by zero.

Usage

Run the program, and you will be greeted with a welcome message. Enter the first numeric value when prompted. Enter the second numeric value when prompted.

Choose the operation you want to perform:

  • for addition
  • for subtraction
  • for multiplication / for division

The result of the operation will be displayed. If you attempt to divide by zero, the program will catch this and display an error message. After each calculation, the program will ask if you want to perform another calculation. Enter "yes" to continue or any other input to exit the program. The program will keep running until the user decides to exit.

Exception Handling

The program includes exception handling to address two specific scenarios:

  • FormatException: Ensures that the user enters only numeric values.
  • DivideByZeroException: Prevents the user from attempting to divide by zero.

How to Run

Compile and run the program using a C# development environment such as Visual Studio or Visual Studio Code. Follow the on-screen prompts to perform calculations

Feel free to explore and modify the code as needed. Enjoy calculating!

consolecalculator's People

Contributors

marciohmb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.