i have a quick question my program goes thro the code normally till it hits where it is supposed to have the second input part and then it totally ignores taht and throws in random numbers? why is this can anyone help me out here?i threw in the dummy because i heard sometimes you have to do that with cin.get() so i wasnt to sure but it didnt do anything so im kind of lost as to what to do?
Code:
#include <iostream.h> 
#include <string.h>
#include <iomanip.h>
const double mem_card = 69.95;
	const double software = 34.98;
	const double nw_pc = 675.00;
	const double disk_drive = 198.50;


int main()
{
/*double mem_card = (double) 0.00;
double software = (double) 0.00;
mem_card = 69.95;
software = 34.98;
	float nw_pc = 675.00;
	float disk_drive = 198.50;*/
double total = 0;
	char item[30];
double num_of;
double times;
char dummy[10];
	/*	int memory;
	int soft;
	int nw;
	int disk;*/ 

cout << "How many items would you like to buy? ";
cin >> times;
for(int i = 1;i <= times;i++)
{
	cout << "Which items would you like to buy(Enter one item at a time then hit enter then type in how many you want to buy)? \n";
	cin.get(item,25);
cin.get(dummy,5);
	cout << "Space filler\n";

	cin>>num_of;
cout << "number of = " << num_of << endl;
	if(strcmp(item,"memory card"))

	total = total + (mem_card * num_of);
else if(strcmp(item,"software")) 
	total = total + (software * num_of);
else if(strcmp(item,"new pc"))
total = total + (nw_pc * num_of);
else if(strcmp(item,"disk drive"))
total = total + (disk_drive * num_of);
else
cout << "That is an invalid choice.\n";

}
cout << "Your total is ";
cout << setprecision(2) << total << endl;
return 0;
}

&#91;code]&#91;/code]tagged by Salem (wondering why ppl with larger post counts still haven't figured it out)