CS 1405 - Lab 8

Objective

  1. Program with selection statements

Preparation

  1. Read section 4.1 - 4.16 (pages 163 - 229) from Starting Out with C++ by Gattis.
  2. Print and complete Worksheet 8.

Programming

  1. Write a program that uses an if/else if statement(s) to determine and output the tax for a given income according to the following table of tax rates.
     
    Income Tax Rate
    >= $70,000 23.5%
    $40,000 - $69,999.99 20.6%
    $20,000 - $39,999.99 18.2%
    < $20,000 12.0%
  2. Verify your program works correctly.
  3. Write a program that inputs a character from the keyboard and uses an switch statement to output a message based on the following table.
     
    Character Message
    a a is for apple
    b b is for banana
    c c is for carrot
    anything else you have selected an undefined food
  4. Verify the program works correctly.
  5. Print the Grade Sheet.  Show your programs to the instructor.

150 East College Avenue * Ephraim, Utah 84627 * Email: ude.wons@nosneros.htrag
© 2014 Snow College * All Rights Reserved
©