University of Delaware

CISC105 - General Computer Science

Lab #4

Decision Making

  1. Goals

    This lab is an exercise to familiarize you with the C Language concept of Decision Making. You will need to perform the following:

  2. "if" Statement Exercise

    Create a program that performs the following five times:

    Use an "if" statement (if, nested if, compound if, or else-if) to accomplish the task. Document your program with a brief description of what it does along with a program name, your name, your section number, date, and lab number.

  3. "switch" Statement Exercise

    Write a small "menu program" that displays the following choices:

    1. Data Input
    2. Sort & Display
    3. Data Update

    Upon entering the number of the choice above, display an appropriate message to the screen verifying the choice that you made. If something other than the choices above is entered, display an appropriate error message to the screen. Use a "switch" statement to accomplish the task. Document your program with a brief description of what it does along with a program name, your name, your section number, date, and lab number.