Lab 5 Assignment

Point Distribution

This lab is worth 10 points and accounts for 12.5 percent of your laboratory grade. The points will be subjectively assigned by your TA based upon whether they believe you made a good faith effort toward complete the tasks that are assigned. Showing up on time, respecting your fellow classmates learning environment, and adherance to laboratory policies also factor into the determination of your score.

The following is an outline of the tasks for you to attempt during the lab period.

A framework containing the files and folders you will need can be found here. Download the .tgz file and decompress it in your account using the command:

tar -xzvf <file_name>
  

Programming Exercises

Find That Letter

Inside the framework folder you will find a folder named letter. In this folder write a program that asks the user to enter a string, and then asks them what letter they want to find in the string. Your program should then tell the user where the letter was found. If the letter was not found, you progam should tell the user.

Find That Word

Inside the framework folder you will find a folder named word. In this folder write a program that asks the user to enter a string, and then asks them what word they want to find in the string. Your program should then tell the user where the word was found. If the word was not found, you progam should tell the user.

Sentences

Inside the framework folder you will find a folder named sentences. In this folder write a program that reads in a paragraph ( or more ) from the user and then prints each sentence of the paragraph on a separate line. Use file redirection to give the input to your program; as typing an entire paragraph every time you test your program is likely to get tedious. ( Beware that a sentence ends with a punctuation mark, not a return character. )

Substring

Inside the framework folder you will find a folder named substring. In this folder write a program that reads in a string from the user. It will then ask the user the beginning position of the desired substring of the string that they input, and the length of the substring. The program should then print the specified substring onto the screen.