I am in the final weeks of the semester taking a basic c++ class. I have already registered for classes next semester and I will not continue to pursue this degree. Sadly, I am not as interested in programming as I believed I would be. I really just want to get these assignments done and save my credit for the class by passing before I move on to my new major. Please help . . .
Use a single-subscripted array to solve the following problem. Read in 20 numbers, each of which is between 10 and 100, inclusive. As each number is read, print it only if it’s not a duplicate of a number already read. Provide for the “Worse case” in which all 20 numbers are different. Use the smallest possible array to solve this problem.
I understand you are supposed to ask for help not just for answers here, but I am simply trying to get through this class, I will not be learning any computer language next year nor will I need it.
A lot of "real life" is non-interesting work that one has to do anyway in order to make the fun possible. You should have learned something on the course. Use that knowledge. Write as much as you can. If you show effort first, some of us can help.
A credit should be an indication that the student has learned certain amount.
This is a pretty neat question, IMO. It requires an algorithm instead of just syntax...
So, the idea is to use an array to store values and as they are input you have to iterate through the array and verify that it was not already added. Your array only has to store already-input values so in the worse case it needs a size of 19.