GithubHelp home page GithubHelp logo

jaromjones / app-vue-calc Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 723 KB

Calculator demo which performs basic maths using the power of Vue, TypeScript, and our minds.

License: MIT License

HTML 2.19% Vue 77.36% TypeScript 1.36% JavaScript 19.09%

app-vue-calc's Introduction

Calcular Demo

Simple Calculator demo which performs basic maths using the power of Vue, TypeScript, and our minds.

Requirements

  • Create a calculator that can add, subtract, multiply, and divide. Don't worry about order of operations.
  • The calculator should display running history of calculations made.
  • The history should be persistent across calculations.
  • Nice to have: the history should persist browser refresh.

Abstract

This is based from vue-calculator sample work per José Salazar The example was modified to meet the above requirements and styled so the history looks similar to a running tape. There were a number of buggy behaviors in the sample. See test cases for more details.

Test Cases

  1. Upon launching app, ensure the display starts with 0. Ensure it displays the minimum viable operators specified in requirements.
  2. Perform a number of random calculations (e.g. 3*3, 15-4, etc) hit = to evaluate each run, confirm the correct maths reported.
  3. Assuming previous test cases pass, ensure the running history logs the successful calculations.
  4. Nice to have - Ensure the modulus operator ("%") and decimal operator are shown (".")
  5. Nice to have - Ensure the C function clears immediate display to 0.
  6. Nice to have - Assuming previous test passes, refresh browser, and confirm the running history is still resident.
  7. Nice to have - Assuming previous test passes, ensure the AC function clears the immediate and running history areas.
  8. Edge case - Hit AC, enter operator without providing number, ensure the display remains unaffected.
  9. Edge case - Hit AC, enter some number value followed by an operator (e.g. "*") then immediately click a different operator (e.g. "/"). Expect the operator is replaced (e.g. * becomes /)
  10. Edge case - Provide an incomplete expression (e.g. 13 *) then click = to evaluate, confirm no calculation occurred, and nothing logged to running history.
  11. Edge case - Enter multiple zeroes for the first operand, then add some value to it, confirm the second value as result.

Build Setup

# install dependencies
npm install

# build for development
npm run build

# serve using webpack dev
npm run dev

# clean up dependencies (requires git)
npm run clean

System Dependencies

# npm version: 6.9.0
npm --version

# node version: 12.6.0
node --version

# git version: git version 2.20.1 (Apple Git-117)
git --version

References

app-vue-calc's People

Contributors

jaromjones avatar dependabot[bot] 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.