Help please!

Alright, so I was given an assignment in a programming class and I'm a bit confused as to what is being asked of me.
The instructions are as follows:
Assignment
"Loops – Write a for, a while, and a do-while loop. For each loop, ask the user for the number and then loop that many times.
Add a function to your program called GetIfElseGrade. This function will have passed in variable of type int and return of char. The function must use an if-else statement to determine a letter grade A(90 and above), B(80-89), C(70-79), D(below 70).
Add a function to your program called GetRangeCase. This function will pass in the char from above (‘A’, ‘B’, ‘C’, or ‘D’) and will print to the screen “90 and Above”, “80 – 89”, “70 – 79”, “60 – 69”, or “Incorrect Value”). Use a switch Case statement in this function."

Ive completed the loop section with out any problems at all as it was quite easy, however the next section has me somewhat confused. I have the if else statements all lined up and working perfectly, but the instructions that have me make a new function to get the range is where im stumped! He asks to use a switch case statement which makes no sense to me because I thought the user had to enter a number for a switch case statement to execute..

Here is a sample output of how he wants it to look
Enter the number for the 'for' loop 4
'for' loop : 1
'for' loop : 2
'for' loop : 3
'for' loop : 4
Enter the number for the 'while' loop 4
'while' loop : 1
'while' loop : 2
'while' loop : 3
'while' loop : 4
Enter the number for the 'do while' loop 4
'do while' loop : 1
'do while' loop : 2
'do while' loop : 3
'do while' loop : 4
Enter a Grade Value (like 75) 75
Your grade for 75 is C
The Range for your grade is 70 - 79


Press Enter to Continue.


and here is my code I have thus far. Im not sure if I even need to use a character array or not.. Any help is appreciated, I understand that you shouldnt just do it for me because I would like to learn, but I need a push in the right direction!
// RevThis.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <string>
#include <iostream> // cout

using std::cin;
using std::cout;
using std::endl;
using std::string;

void GetIfElseGrade();
void GetGradeRange();

int _tmain(int argc, _TCHAR* argv[])
{
int numFor;
int numWhile;
int numDoWhile;

// For loop
cout << endl << "Enter the number for the 'for' loop: ";
cin >> numFor;

for(int i=1; i<=numFor; i++)
{
cout << "For loop number " << i << endl;
}

// While loop
cout << endl << "Enter the number for the 'while' loop:";
cin >> numWhile;

int x=0;
while(x<numWhile)
{
x++;
cout << "While loop number " << x << endl;
}

// Do-while loop
cout << endl << "Enter the number for the 'do-while' loop:";
cin >> numDoWhile;

int j=0;
do
{
j++;
cout << "Do-while number " << j << endl;
}
while(j<numDoWhile);

GetIfElseGrade();
GetGradeRange();

system("pause");
cout << endl << endl;
cout << "Press Enter to Continue."; cin.get();
return 0;

}

void GetIfElseGrade()
{
int getGrade = 0;
char getLetter = ' ';

cout << "Enter a grade value (like 75): ";
cin >> getGrade;

if(getGrade>=90)
{
cout << "Your grade of " << getGrade << " is an A." << endl;
getGrade = 'A';
}
else if((getGrade>=80)&&(getGrade<=89))
{
cout << "Your grade of " << getGrade << " is a B." << endl;
}
else if((getGrade>=70)&&(getGrade<=79))
{
cout << "Your grade of " << getGrade << " is a C." << endl;
}
else if(getGrade<=69)
{
cout << "Your grade of " << getGrade << " is a D" << endl;
}
}
void GetGradeRange()
{
If(getGrade
}
He asks to use a switch case statement which makes no sense to me because I thought the user had to enter a number for a switch case statement to execute..
yes, ¿your point?
1
2
3
4
5
6
void print_range(char grade){
   switch(grade){
   case 'A': std::cout << "90 and Above"; break;
   //...
   }
}
Ah, with a few tests I see now. I was always taught to set selection=0 then the user would have to actually type 1,2 or 3 for the selection they wanted. I see now that it can run automatically. Thank you very much! And thank you for being informative without doing it for me as well!
Topic archived. No new replies allowed.