12 Computer Can Do The Math

What are some ways by which computer’s mathematical abilities can help us?

Vocabulary

Order of Operations, + - * / %, =, operator, random( ), const, PI, ==, ===, !=, x++, x+=5, Concatenation

Study Questions

  1. Does the computer follow an order of operations like the one in math?
  2. What is the importance of an order of operations?
  3. In what kinds of scenarios, could you use randomness?
  4. Explain when each of the = ,==, and === symbols should be used ?
  5. What are other ways of writing x++ and x+=10?
  6. When and how are && and || used?
  7. What is string concatenation? Provide an example.
  8. What is a template literal? Give an example of a template literal.

Activity

  • Watch Video #1 (below)
  • You are creating a calculator app for one formula. Look at your math/physics/chemistry class notes for ideas. (Area formulas, Quadratic formula, Law of Cosines, Volume formulas etc.)
  • You must use p5.js to create input fields in your html for each variable used in your formula for computation and a submit button that executes the computation.
  • You must draw a visual for your calculator. Declare variables in your program that can be changed to evaluate the formula for different values. Style the output so that the answer is presented clearly. If you are doing the area of a triangle, for example, draw out the triangle on the canvas and update the labels on its sides as new inputs are given.
  • Create a styled webpage using the above wireframe as a guide. Your website should highlight the calculator app.
  • Make your website responsive (meaning it should scale to different sizes and adjust its content to best style for the different screen size) using flexbox and media queries. Use media queries to change section colors below 600px.
  • Make sure to give a TITLE to the website, use a favicon, and write a meta description in the head section.
  • Comment sections of your code in all files.
  • Answer the vocabulary and study questions from this lesson. All descriptions must be in your own words and relevant in regards to our class.

Resources

  1. Video: 12 Computer Can Do The Math
  2. Link: P5.js reference - Math