Need help!!

Hello good people,
My program seems to have a problem when i try to quit it by pressing 'q'. Can somebody please tell me what I am doing wrong??
thanks
// Lab08Ex1.cpp - Count number of number of pledges
// Created by Man-Chi Leung on 12/13/10

#include <iostream>
#include <stdlib.h>
using namespace std;

int main( )
{
int comboa = 0;
int combob =0;
int comboc=0;
int voteb = 0;
char combo ;
double totamt= 0.0;

cout << "Enter the combo ordered by the first costumer A/B/C [ q/Q to stop] ";
cin >> combo;
combo = toupper(combo);
while ((combo != 'q')||( combo != 'Q'))
{
if ((combo == 'A')|| (combo=='a'))
{
comboa = comboa + 1;

}
else if ((combo == 'B')|| (combo == 'b'))
{

combob = combob + 1;
}
if ((combo == 'C')|| (combo=='c'))
{
comboc= comboc+1;
}
cout << "Enter the cambo ordered by the next costumer [ q/Q to stop]";
cin >> combo;
}
cout<< " number of combo A ordered: "<< comboa << endl;
cout<< " number of combo B ordered: "<< combob << endl;
cout<< " number of combo C ordered: "<< comboc << endl;
totamt = (comboa * 6)+(combob * 6.25)+ (comboc * 5.75);
cout<< " Total amount due: "<< totamt << endl;


system("pause");
return 0;
}
Last edited on
while ((combo != 'q')&&( combo != 'Q'))
try using cin.synch before reading from the input stream
Last edited on
Topic archived. No new replies allowed.