Tomorrow I have a C++ test in my grade 11 computer science course and my teacher gave us a few problems to do/practise at home. (Note we use Visual C++ from Visual Studio 6.0)
Problem 1. Have the user input a 4-digit character array or string. Have your program convert this string into an integer value without using the atoi function.
As it clearly states, i cannot use the atoi function. Now a previous question wanted the opposite (integer to char array) with itoa function and i got that working with the code i have in the txt file.
Problem 2. Have the user guess at random number. Have the computer tell the user either “Higher” or “Lower” until correct. The program will show the total number of guesses. Also, if the user is a moron, tell them so. For example, assume the correct number is 12. If the user inputs 7 and your program informs the user “higher”, if at any later time the user inputs a number of 7 or lower, the program is permitted to call the user a “moron”.
My question is if someone can please help me by coding this, just so that i can review the code and be ready for the test tomorrow. I've missed the class the last 4 days with the flu and have fallin a little behind. Also, if you could code it at a similar level as the code in the txt file, i would really appriciate it because thats how far our class as gotten so far. Please refer to the text file.
PS: I know it may not be exactly whta you'd want to do, but i would really appriciate it and it would help me dramatically.