20 pts Question 8 A) Write a function that accepts a string parameter containing a list of integers (you do not know how
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
20 pts Question 8 A) Write a function that accepts a string parameter containing a list of integers (you do not know how
Question 8 A) Write a function that accepts a string parameter containing a list of integers (you do not know how many numbers or what values they may be) B) The function will display a sorted list of unique values between 10 and 100 (in other words: is a number is written multiple times in the list, it will be printed only once. Also, all values less than 10 or greater than 100 will be ignored) RESTRICTIONS: 1) You can NOT use any conditional statements (if/switch/?:)...note: this is not an invitation to write inappropriate code (like using 'while" as a replacement for "if" statement). This restriction is to help you write optimal and proper code for this problem. 2) Your function can contain a MAXIMUM of two loops. No more loops allowed. 3) YOU CAN NOT USE anything we did not learn in class (no external libraries or functions including built-in sort functions) HINT: 1) This is a test in thinking, so do not be an English translator approach the problem from factual perspective 2) this function is as simple as 2 loops where each loop contains 1 line of code. 3) We did something very similar in the lecture. EXAMPLE: Calling the function with the following list of numbers: 50 555 20 2 -2 30 30 751 20 11 30 0 prints: Your list is: 11 20 30 50
20 pts