Thread: Code Help
View Single Post
Light Poster
11Feb2009,21:27  
carvin317's Avatar
okay so now im onto data validation. When it asks for how much a gallon of pain is i want the numeric number to be between 1-50 if it is not i want a message to display enter a number between 1-50 and have the question asked again and then when they do it move onto the next question. would that be a do while loop ? am i on the right track?


Code:
do{
	cout <<"What is the cost of paint per gallon?";
		cin >> Fcostper;
		cout<<endl;	
}	
while (Fcostper < 0 || Fcostper >50)
		cout<<"What state are you located?";
		cin>>sState;
		cout<<endl;