If i want users to input either (A,B,C,D,F), each letter will represent 4,3,2,1,0 respectively, so its like when user input A, then i want to show his input value is 4, what do i do ?
#include <iostream>
usingnamespace std;
int main()
{
char letter;
cout<<"enter a letter: "<<endl;
switch(letter)
{
case'a':
case'A': cout<<"4"<<endl; //however, i dont want to just show its 4, i want it to be stored, like a=4, can it be done ?
break;
}
system("pause");
return 0;
}
im sorry to get you confused in the first place, what i want is get user to input few letters, and sum up their corresponding number values and get the average...but, only the part that need to store the letter value confuses me....