Giter Site home page Giter Site logo

bodmas's Introduction

Bodmas

##calculator The calculator application is a simple terminal (command line) based application that allows a user perform simple calculations, define arithmetic formula and use them. The program allows a user enter input text and respond based on what the user enters. The following actions should be possible:

  1. Simple arithmetic expressions e.g. 2 * 5 - (3 + 2) The calculation should be done based on BODMAS and the result displayed. The supported operators would be (), *, /, +, - and ^

  2. When the input is an expression of the form: fn = expr where fn is a string denoting a formula name and expr is an arithmetic expression that may contain variables (parameters of the formula), the formula should be saved to storage in such a way that it can be retrieved using the formula name.

  3. When the input is a simple string e.g. fn, the program should check if there exists a formula with the given name and display the formula. If not display an error message.

  4. To use a formula, an expression of the form fn(a,b,c) should be entered by the user; where fn is the formula name and a, b and c are parameters in the formula.

  5. a, b, or c in the expression above could themselves contain nested formula and expression e.g. fn(a, b, fn(c, d, e))

The program should run (request input and provide output) indefinitely until a chosen string is entered as input which would signal to the program to terminate. Invalid input (not matching any expected format) should attempt to provide a meaning error message to the user. ###Adescode

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.