{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

208 Lab 04 - Rochester Institute of Technology Golisano...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Rochester Institute of Technology Golisano College of Computing and Information Sciences Department of Information Technology 4002-208 Page 1 of 5 Fall 20081 Name: ____________________________________ 4002-208 Lab 4: switch statement and sentinel loops Exercise 1 – switch statement (2 points) This exercise must be completed during the lab period. 1. In this exercise, you are to write a program to read a letter grade [use char, not string] and determine its “point” value [use int] based on the following table: Grade Points A or a 4 B or b 3 C or c 2 D or d 1 F or f 0 All others 0 After the user enters the grade, print the associated number of points. You must use a switch statement. Note: since you will be using this code in the next two exercises, do not print inside the switch statement. Assign the points to a variable and then print the message with the points after the switch statement.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Lab 04 Sample Output When your program works correctly, have the instructor or the teaching assistant check your program and initialize the handout below.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.