Announcements
We will have a simple 5 minute quiz at the beginning of the lab on Blackboard. Please sign in to your Blackboard account and finish the quiz individually. To access the quiz, go to CS 141 course on Blackboard, and click on Lab Quizzes, there you can find Lab 11 quiz. To access the quiz, you will need a password, which will be announced by the TA in the lab.
The full version of lab assignment is on Blackboard, under the link "Lab Assignments" > "Lab 11 Programming Activity". To access the assignment, you need a password, which will be announced by the TA in the lab.
You must work with a single partner, in a group of 2. You must take turns being the “driver” and the “navigator”. (If there are an odd-number of students in the class, your TA will make an adjustment.)
Lab Activity
During the lab, you will need to implement functions to practice recursion. You will take functions that work non-recursively, and you will rewrite them to work recursively.
Stages You Need to Do
Problem 1 (1 point) :
Display odd numbers less than some limit. Complete the function problemOneOddNumbersRecursive given in the .cpp file below.
Problem 2 (1 point) :
Count the number of upper-case letters in an array. Complete the function problemTwoCountUpperRecursive given in the .cpp file below.
Problem 3 (Extra credit) :
Reverse a string of characters. Complete the function problemThreeReverseRecursive given in the .cpp file below.
**Note: If you use lab computers, you need to first connect to the bert server for compiling and running the program, as the lab computers do not have c++ compiler.
Do the following steps:
1. open "terminal", and type: ssh username@bert.cs.uic.edu
2. it will ask for your password: ( the username and password are the same as the cs account username and password you used to log into the lab computers.)
3. find your program file and use g++ to compile. (for example, if your "lab11.cpp" file is saved on Desktop, then you need to do: cd Desktop and then: g++ lab11.cpp
4. run the program: ./a.out