programs that perform operations pt 1-Due 4/14

  1. Objective: Create a program that calculates the sum of all the number from 1 to any given number.
    • Example: if the given number is 5, we would need to add 1+2+3+4+5. That would equal 15. It gets harder if the given number is 100.
  2. There are 2 methods. We must create both apps and then compare them by answering the questions in part 5 and 6 below. Create both apps in the same file.
  3. One way is to create a list of all the numbers (such as 1-5) and then use combine. Here are the videos- video1, Video 2. Save as U5L3pg1
  4. Another way is to use this function (N*(N+1))/2. Here is the video
  5. Answer these questions in an email to Mr. Melendez
    • Use 100 as the number. What is the sum?
    • Which program calculated the sum faster?
    • Why do you think that happened?
  6. The difference in time is also referred to as program efficiency( how quickly a program can perform an operation).
    • Which program was more efficient?