The reason you keep going to the default in the switch is the while loop

while (( Pnumber = getchar() ) !=EOF )

Pnumber is reset (Pnumber = getchar()) after the initial entry after the prompt. (cin >> Pnumber)

Why do you redeclare each of the variables within each case of the switch statement. They will go out of scope when you exit the swtich statement and the wrong values will be output at the end of the program.

Note that you will only be prompted once for what to enter. You may want to move the prompting to within the loop.

Hope this helps.

Chuck Grady