|
|
|
|
|
|
What happens on line 35 when y is 0 ? |
line 25 - what happens if a number less than 1 or greater than 4 is entered or a letter is entered ? |
As you have written the class it is mostly useless and the class is not really need because the "getUserInfo" function could be a stand alone regular function. In the "getUserInfo" function I would have used a "switch" in place of the "if" statements. Also be sure to initialize you variables when you define them, it is just good programming practice. Line 4 "using namespace std;" is not a good idea. It can be used in a simple program like this, but in the future it will cause problems. This link will give you some understanding: http://www.lonecpluspluscoder.com/2012/09/22/i-dont-want-to-see-another-using-namespace-xxx-in-a-header-file-ever-again/ Also you could do a search here for some good information. "main" will work as is. You are likely to find with VS that the console window will close to soon when the program is finished. Check this for some ideas: http://www.cplusplus.com/forum/beginner/1988/ If you have any questions about VS send me a PM and I will help all I can. Hope this helps, Andy |