#|------------------------------------------------------------------|# #| Extra Credit Assignment |# #|------------------------------------------------------------------|# This assignment is worth at most 25 percentage points on a homework assignment. Since this is an EXTRA credit assignment, it's going to require EXTRA effort on your part. You are expected to look up information for this assignment on your own. The built in Help Desk is an excellent resource. This assignment will cover a topic that has not been and will not be discussed in lecture or recitation: strings. To get you started, type "hello world" (with the quotes) in a Dr. Scheme interpreter. That's a string. A string is a sequence of characters. So what's a character? Search for the Revised(5) Report on the Algorithmic Language Scheme (known as R5RS) in the Help Desk, then check out sections 6.3.4 and 6.3.5. After reading about strings and experimenting on your own you should see that strings are similar to vectors in many ways. Also, please note that THIS IS AN INDIVIDUAL ASSIGNMENT. YOU ARE EXPECTED TO FOLLOW THE HONOR CODE AS IF THIS WERE A REGULAR HOMEWORK. This assignment is due Friday, 27 July 2001 at 8:00am. There will be NO extra credit assignments accepted late for any reason. #|------------------------------------------------------------------|# #| RESTRICTIONS |# #|------------------------------------------------------------------|# For this assignment you may NOT use any libraries. This means no "require-library" function calls. #|------------------------------------------------------------------|# #| Grading |# #|------------------------------------------------------------------|# As per any assignement, you must have good style, but unlike regular assignments, there will be no style points. In order to get credit for a problem you must have both correct code and good style. One without the other means no credit. There will be no partial credit for a problem; it's all or nothing--remember that this is an EXTRA credit assignment. Problem one 1 point Write a function called reverse-string. It should take in a string as its parameter and return a NEW string with the characters in reverse order. Your function must work for ANY string (that includes the empty string). Problem two 2 points Write a function called reverse-in-place. It should take in a string as its parameter and reverse the characters of that string. This function should return a the changed string. (hint: remember that strings are pass-by-reference) Problem three 2 points Write a function called to-upper! (yes, include the '!'). It should take in a string and change all of the letters to uppercase. Leave numbers alone. Return a reference to the changed string. Problem four 3 points Write a function called number-of-vowels. It should take in a string and return the number of vowels in the string. (HINT: good style includes good abstraction) Problem five 3 points Write a function called is-palindrome? It should return #t if the string is a palindrome and #f if it is not. If you are unsure what a palindrome is then consult www.google.com. Problem six 4 points Write a function called find-substring. It should take in two strings. If the first string occurs within the second string then return the index in the second string where the first string begins. If the first string doesn't occur within the second string then return #f. Problem seven 5 points Write a function called get-all-paths. It will be called just like the dfs and bfs functions from homework five, but instead of returning one path, return a list of ALL possible paths (remember that a path has no cycles). You may use whatever kind of search you like. Problem eight 5 points Write a function called sorted-paths. It will be called just like get-all-paths. It should return a list of paths, but the paths should be sorted such that the shortest path comes first. Once again, you may use whichever search you feel is appropriate.