Vector:: 1. Define an empty integer vector. The vector size will be changed each
ID: 3648766 • Letter: V
Question
Vector:: 1. Define an empty integer vector. The vector size will be changed each time user insert or delete. 2. Use a random function to generate an integer between -10 and 10, display the number, insert the number into the end of vector, and display the contents of vector. 3. Repeat 10 times for step 2 to insert the generated integers into the end of the vector if the number is not in the vector. Please make sure that there is no duplicate integer will be inserted to the vector. 4. Display a menu with option to insert, delete or exit. a. For insert, you need to ask user to enter an integer between -10 and 10. Check if the number is in the vector. i. If yes, display and message showedExplanation / Answer
Look at the values of the local variables I posted. They are all inf and nan. The word "range" becomes meaningless with such virtual non-quantities. If the values were normal you would probably be right. But your assumptions turn to shreds when you feed your functions with inf and nan.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.