Skip to content

Applying what you know

Jack Schumacher edited this page Jun 19, 2026 · 1 revision

Lets create a handful of math problems and print the results. The point of this task to apply what you have learned so far. To do this, do the following:

  1. Create 4 addition calculations
  • Example: 1 + 2 = 3
  • There should be three variables created for each number in each calculation
  • One math problem should be done with integers
  • One math problem should be done with floats
  • One math problem should be down with doubles
  • One math problem of your choice
  1. Create 4 subtraction calculations
  • Example: 1 - 2 = -1
  • There should be three variables created for each number in each calculation
  • One math problem should be done with integers
  • One math problem should be done with floats
  • One math problem should be down with doubles
  • One math problem of your choice
  1. Create 4 multiplication calculations
  • Example: 2 * 2 = 4
  • There should be three variables created for each number in each calculation
  • One math problem should be done with integers
  • One math problem should be done with floats
  • One math problem should be down with doubles
  • One math problem of your choice
  1. Create 4 division calculations
  • Example: 4 / 2 = 2
  • There should be three variables created for each number in each calculation
  • One math problem should be done with integers
  • One math problem should be done with floats
  • One math problem should be down with doubles
  • One math problem of your choice

Reflection

  1. How well did you do?
  • Think about how many attempts it took to get it right.
    • Even the best programmers have to get it wrong multiple times before their code finally works.
    • It's okay if you needed to get help, even when working on the robot, you may need to get help from your sub-leads to get help with a new problem you have never seen before.
  1. Was it annoying to write so much code?
  • 64+ lines for writing 16 problems must be super annoying, and resulting in lots of copy and pasting.
  • There is an easier way to repeat code that we are going to learn now.

Clone this wiki locally