Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello...
I would like some feedback on how to write a switch statement on displaying a menu on writing choices, like C for check, D for Deposit, W for withdrawl, and Q for Quit. Allow user to use upper and lower cases.
I believe it's :
case 'D'
case 'd'
for example right?
Then the program asks user to input: if user selects 'D' then ask user to enter the amount of deposit, then add account balance.
Anyway, any help is appreciated.
I did write it out in another post but no-one replied, I think C++ scares folks, hey me to.
[Removed irritatingly excessive use of smilies]
Posted
Updated 18-Dec-09 17:18pm
v4

1 solution

Yes, that's how it is done, except for the syntactical error in your representation
case 'd':
case 'D':
//your code here
break;


There are examples here:
http://www.cplusplus.com/doc/tutorial/control/[^]
http://msdn.microsoft.com/en-us/library/k0t5wee3(VS.80).aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900