Giter Site home page Giter Site logo

calculator's Introduction

Calculator App

I forked this from my old repo and refactored it with better styling and more functionality.

The purpose of this app is practicing a short build from start to finish in one sitting.

  • Practicing jquery
  • Streamlining Bootstrap usage
  • Using a switch() statement

Functionality:

  • add
  • subtract
  • multiply
  • divide

File Structure:

Basic MVC

|⟼ server.js
|
|⟼ /views
|        ↳ index.html
|
|⟼ /routes
|        ↳ htmlroutes.js
|
|⟼ /public
|        ↳ /assets
|              ↳ /css
|                    ↳ style.css
|              ↳ /js
|                    ↳ calApp.js

HTML

HTML page uses buttons with the values of 1-9, operators and an equals sign that will complete each equation and clear button to rest the page regardless of the state.

Styles

The layout is done with a linked stylesheet (style.css) and the Bootstrap cdn for the grid system.

JS/JQuery

Javascript file links to the above html file.
It completes each operator's function while adding each equation and solution to the html page using jquery.

Persistance

In it's current stage, this app has no persistance.

Deployment

Deployed on Heroku: View App

Notes

  1. Issue ⟼ Second number shows all inputs. It should mimic the first number's input.
    Solution ⟼ Changed line 27 from .append() to .text(parseInt(firstNum) + " " + operator + " " + parseInt(secondNum))
                ↳ Fixed

  2. Add Feature ⟼ Add Info: even or odd.
    Solution ⟼ Added a function that triggers when the equals button is press and display the results of the function in an html div
                ↳ Added

calculator's People

Contributors

zaxblackdragon 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.