1. Define an empty integer vector. The vector size will be changed each time use
ID: 3546379 • Letter: 1
Question
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 showed
Explanation / Answer
1. Define an empty integer vector. The vector size will be changed each time use
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.