Difference between revisions of "CSC111 Final Exam 2018"
Line 263: | Line 263: | ||
Write a program called '''final4.py''' containing a recursive function similar to the functions we created in class, using Dave and Gru as example. Your program will prompt the user for a list of integers, and will print "True" if there are two numbers in the list that are consecutive and have the same value, and it prints "False" otherwise. | Write a program called '''final4.py''' containing a recursive function similar to the functions we created in class, using Dave and Gru as example. Your program will prompt the user for a list of integers, and will print "True" if there are two numbers in the list that are consecutive and have the same value, and it prints "False" otherwise. | ||
<br /> | <br /> | ||
− | Your program must use a recursive function to determine if the there exist two consecutive numbers that have the same value. Programs that solve the problem using an iterative loop, and not using recursion will automatically get 0/100. | + | Your program <font color="magenta">'''must use a recursive function'''</font> to determine if the there exist two consecutive numbers that have the same value. Programs that solve the problem using an iterative loop, and not using recursion will automatically get 0/100. |
<br /> | <br /> | ||
Examples of interactions with the program: | Examples of interactions with the program: |