I wrote this program, and it has no errors, however you must enter a value and press enter twice each time it prompts for user input for the program to continue running. for example,
"enter value"
5 [enter]
5 [enter]
"you entered 5"
of course thats not my program, just what my problem is. Here's the Code:
I wrote this program, and it has no errors, however you must enter a value and press enter twice each time it prompts for user input for the program to continue running.
I'd say that was an error!
Before each obj.verifyin() you get input. In each obj.verifyin() call you get input.
This may have something to do with why you have to enter a value twice. Coincidentally, if the initial input fails, subsequent input in the verifyin() method is discarded.
well i took out the input before each obj.verifyin() and i only have to enter the number in once, but now when i try to do obj.verifyin(input) without prompting any input for it before hand, i get really messed up numbers. i enter in that i want 5 movies and it returns -1.38195e+009. i want to run the function but store the input as the variable "input."
remember that cin >> var returns a bool when used in a while loop. In your class you ask whether the cin returns true of false. In order to get true or false the computer must ask for input(again)
oh god, nevermind I forgot about entering in floating point numbers. Lol oh well, at least my initial problems are solved. Thanks guys! One more thing, would anyone be willing to critique my code? Is there more efficient ways of doing what I'm doing?