Difference between revisions of "CSC111 Final Exam 2018"

From dftwiki3
Jump to: navigation, search
Line 217: Line 217:
 
=Problem 4=
 
=Problem 4=
 
<br />
 
<br />
Dave, here's a bunch of banana.  Can you tell me if there are two bananas next to each other that have the same weight?
+
'''Dave, here's a bunch of banana.  Can you tell me if there are two bananas next to each other that have the same weight?'''
 
<br />
 
<br />
Write a program that prompts the user for a list of integers, and prints out "True" if there are two numbers in the list that are next to each other 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.
+
Write a program containing a recursive function, that prompts the user for a list of integers, and prints out "True" if there are two numbers in the list that are consecutive and have the same value, and it prints "False" otherwise.
 +
<br />
 +
Your program must use a recursive function to determine if the there exist two consecutive numbers that have the same value.  Programs that do not contain a recursive solution will get 0/100.
 
<br />
 
<br />
 
Examples of interactions with the program:
 
Examples of interactions with the program:

Revision as of 08:38, 28 April 2018

D. Thiebaut (talk) 11:39, 26 April 2018 (EDT)



...