------------------------------------------------------------------------------- CS99, Fall 2002: Homework 7 Due Monday 11/11 at BEGINNING of LECTURE (9:05am) ------------------------------------------------------------------------------- General guidelines: + For the following problems, write each program in a separate M-File. + Remember to follow the submission guidelines as specified in the syllabus! Submission for lecture: + Print all files and the grading guide. + Staple the grading guide on top of your work. Electronic submission: + Zip all of your M-Files together in a file called _h6cs99.zip . + E-mail the zip file to cs99@cs.cornell.edu *before* the deadline. Late submissions: + We do not accept ate submissions in person or by e-mail. + If you miss the deadline, you will be required to perform extra work on the final project. ------------------------------------------------------------------------------- 1. Write a program that prints a right triangle out of asterisks given a user-input size for the height. An example session follows: >> Please enter the size of the triangle: 5 * ** *** **** ***** To receive full credit, you must use a nested control structure. You may assume that the user enters a legal size. Do not use arrays to store the picture. 2. Write a program that mimics the behavior of STRCMP for two strings. Your program will prompt the user for two strings and then compare them. The output of your program should be identical to that of the real STRCMP. If you would like bonus points, write your solution as a function called MYSTRCMP, which takes as input two strings and returns the same result of STRCMP. 3. Write a program that prompts the user for a string and then converts it to lowercase, titlecase, and uppercase. For example, the string blah has the following forms: lowercase: blah titlecase: Blah uppercase: BLAH Even if the user-input string already exists in one of these forms, the program will still generate the three cases. 4. Background: Encryption is the process of trying to convert readable text into an unreadable form. Rotation is a simple form of encryption in which a character is shifted a given number of characters to the "left." For example, a shift of 3 converts 'd' to 'a'. Task: Write an M-File rotate.m that outputs a character array that contains the rotation of the lowercase English alphabet for an input of a value of shift. Assume that shift is a legal integer between 0 and 26. For instance, a shift of 3 on the array 'abcdefghijklmnopqrstuvwxyz' produces a character array in the order 'xyzabcdefghijklmnopqrstuvw'. -------------------------------------------------------------------------------