Skip to content

Instantly share code, notes, and snippets.

@froilan-miranda
Created September 8, 2016 19:40
Show Gist options
  • Save froilan-miranda/196a463be44404981297f2d68c5a4d2d to your computer and use it in GitHub Desktop.
Save froilan-miranda/196a463be44404981297f2d68c5a4d2d to your computer and use it in GitHub Desktop.

Sum or Product

Objectives

  1. To demonstrate your understanding of objects
  2. To demonstrate your understanding of operators
  3. To demonstrate your understanding of user input
  4. To demonstrate your understanding of functions

Overview

Write a program that asks the user for a number n and gives him the possibility to choose between computing the sum and computing the product of 1,…,n

Unit Test

No Unit Test

Instructions

  1. Get input from user for number n and choice of Sum or Product
  2. Create separate functions for Sum and Product
  3. Compute for Sum/Product
  4. Print final output to screen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment