Assignment 2

For this assignment, build a calculator with React that handles only 2 numbers.

Live example: https://itp404-assignment-2.surge.sh

How to use it:

  1. Click a number
  2. Click an operator (plus, minus, divide, multiply)
  3. Click another number
  4. Click equal
  5. Click C to clear and start over

This is not a very robust calculator, so this assignment does not require the use of loops, arrays, or objects. It only requires click handlers, if statements, and state that contains primitive data types.

Your implementation shouldn't have any direct DOM manipulation. All rendering should be done by React via state changes.

If you are unsure how to get started, check out this Gist with some starter code.

Other Requirements

  1. You are not allowed to use any libraries. Your implementation should only use React and optionally Bootstrap.
  2. Your implementation must only use the techniques, patterns, and concepts that we covered in class.
  3. Your implementation should not have any direct DOM manipulation or have any references to document or window. All rendering should be done by React via state changes.
  4. There shouldn't be any console warnings or errors when running locally or when deployed to Surge.

Submission

Create a video with audio using Zoom where you demo your assignment and explain where you fulfilled or did not fulfill each requirement. Put a link to this recording in the README.md file at the root of your project.

https://classroom.github.com/a/oBD2wjGz

If you're having problems uploading to GitHub, please zip up your project and email it to the instructor and TA. Be sure to exclude the node_modules folder from your zip file. Please include the Zoom recording URL in the email. You can also zip up your project, put it in Google Drive or Dropbox, make the link sharable, and email that link to us.