CIS 110 Spring 2013 - Introduction to Computer Programming

upenn.edu | directories | van pelt library
seas.upenn.edu | CETS | engineering library
computer graphics & game dev (SIGGRAPH @ Penn) | dining philosophers (DP) | science & tech wing (STWING) | women in cs (WICS)
CETS Answers

Recitation 6 Exercise

Goals

The goal of this week's recitation assignments is to work with multiple branches in TOY.

Exercise

  • Write a TOY program that reads in 3 numbers from StdIn - check, num1, num2. If check is equal to 1, subtract num2 from num1 and print the result to StdOut. If check is equal to 2, add num1 and num2 and print the result to StdOut. If check is equal to 3, just print num1 to StdOut.