COS120 Lab Exercise #6

Instructor: Larry Latour

Lab Supervisor: Dan Bissell and Sidharth Kudige

Your Names: _____________________________________________________________________________

LAB ASSIGNMENT:

You are to create a program, with the use of functions, that takes an input string and distorts that string for output. The form you will use has two text fields one for input and one for output. The command button Run is included to initiate processing.

You are to first input the word "Fantasia" and output the word "FANTasia", then input the word "Unbelievable" and output the word "UNBELIevable". You must write the following three functions: SplitPoint, RightUCase, Swapper, and then write your program using only these three functions. The parameters and functionality of the three functions follow:

SplitPoint:

-Input: OriginalString as string

-Output: SplitPoint is half the length of OriginalString rounded to the nearest whole number.

-Example: if OriginalString is the string "hello", SplitPoint is 3.

RightUCase:

-Input: OriginalString as string, BreakPoint as single

-Output: RightUCase is a modified version of OriginalString as follows: the point Breakpoint back to the first character is lowercase and the point Breakpoint + 1 to the last character is Uppercase.

-Example: if OriginalString is "Funny" and Breakpoint is 4, then the output string RightUcase is "funnY"

Swapper:

-Input: OriginalString as string, BreakPoint as single

-Output: Swapper is a modified version of OriginalString as follows: the point BreakPoint + 1 to the last character is switched with the point Breakpoint back to the first character.

-Example: if OriginalString is "funny" and BreakPoint is 4, then output is the string yfunn.

HINTS:

 
 -Use the Right and Left string functions  -Understand and use the UCase function
 -Understand and use concatenation  -Understand and use the Round function
Submission instructions:
 1. Print a text listing of your form as follows: In Visual Basic, select File/Print and check the box: Form as Text. This printout will display the properties of the controls in English.
 2. Print a text listing of your program code as follows: In Visual Basic, select File/Print and check the box: Code.
 3. Run the program and print a screen capture like the example above. (Screen Capture by ALT-PRINT SCREENing the desired running form and pasting the capture into WordPad)


Last Updated: 11/04/99