Oct 2, 2013 at 4:00am UTC
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 ?
getting confused here, ps i'm still a newb...
Oct 2, 2013 at 4:02am UTC
What have you written so far?
Oct 2, 2013 at 4:06am UTC
nothing yet, but i want to get some ideas, or samples if possible
Oct 2, 2013 at 4:07am UTC
Do you know how to use a switch-case construct? If not, can you use if and else statements?
Oct 2, 2013 at 4:27am UTC
Why not make an int variable named a on line 8?
Oct 2, 2013 at 4:32am UTC
the thing is, which letter variable should i make ? users have choices, not just "a", you know what i mean ?
Oct 2, 2013 at 4:37am UTC
I still don't understand what you want. Can you show sample input and output?
Oct 2, 2013 at 4:45am UTC
forgive my inexperience in c++ and lack of certain c++ terms....
what i meant was, even i make an int variable named a on line 8, what if user input B, or C, or D, or whatsoever ?
and switch function is only for int and char right ?
is there any better way like if...else if etc ?
Oct 2, 2013 at 4:48am UTC
What confuses me is that in your first post you asked for one thing and then in your third post you asked for something different.
Oct 2, 2013 at 5:10am UTC
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....
Oct 2, 2013 at 5:20am UTC
Make an int variable and add to it based on which letter was entered.
Oct 2, 2013 at 5:59am UTC
oh, thanks, i will try that, because professor didnt teach that kinda stuff yet....
by the way, can i do multiple at a time ? or have to repeat it 3 times if i want user to input 3 letters
Oct 3, 2013 at 4:00am UTC
Why didn't you use a looping structure?
Oct 3, 2013 at 4:22am UTC
because i am new to c++, and still exploring, thats why i got stuck on capturing letter variables