Group Forums >> web developers and designers >> C++ Help
C++ Help
|
21 posts back to top |
Posted 7 months ago Hello please help I am student Computer Science Information systems and Star Class of programming I in C++ , and I am Writting a program to do this
Write a program that asks for the names of three runners and the time it took each of them to finish a race. The program should display who came in first, second, and third place. my probelm is here Input Validation: Be sure the names do not overflow the arrays. Only accept positive numbers for the times. please help
|
|
30 posts back to top |
| Posted 7 months ago I am not sure if you know this, but you are in the web dev forum. There is a C++ forum in this site. You are in luck though seing as I am a C++ programmer by heart. Couple of questions. Are you going to include the string lib or are you going to just make arrays of char the hard way. If you make them with the string variable by loading the string lib then you do not have to worry about over flow. The positive number thing is easy. You just need to make userInput < 0 in your while statement. If this evaluates to be true then you will have the user input a new response until they get a correct response. Please upload your code into the forum and i will help you out with the formating of the code and get you a running program. To do this properly click the soure button in the reply window at the top and type the following. <p> Info text you want to state before showing code. <p/> <p> The Code. <p/> This way all the code will show up on the apropriate lines when posted. I hope this message give you a bit of hope. =-) James |

