CIS Logo SVC Logo

   Computing & Information Systems


Schoology Facebook        Search CIS Site      Tutorials

Software Design Using C++

Review of Decision Statements

Answering the Question

First, we repeat the description of the problem: Write a C++ function that is given an integer grade (such as 90, 84, 66) and sends back the corresponding letter grade (such as A, B, D) in the function name. Return the letter I for any invalid grade number. If you need to review how to carry out choices in C++ first, go to the Decisions, Decisions section of these web pages.

Second, let's write an outline of the function and supply the documentation that describes what it should do.

/* Given:  NumGrade   A numeric grade (whole number).
   Task:   To find the corresponding letter grade.
   Return: This letter grade in the function name.
char LetterGrade(int NumGrade)


Can you now fill in the code to finish this function? Click on NEXT to see possible answers.

You can go back to the overall review listing: Review of Introductory Topics.

Back to the main page for Software Design Using C++

Author: Br. David Carlson with contributions by Br. Isidore Minerd
Last updated: January 15, 2013