In this assignment, you will work with string methods. You use those methods to filter information from a piece of text, edit a piece of text, and determine where a particular word is in the text.
Create a Windows Forms application in Visual Studio with a form containing a Textbox, a Button and a Label. Read through the OIS dictum and master the theory of string methods (also called string functions) IndexOf, Replace and Substring.
User requirement:
The user types (in the Textbox) any text. After this, the user clicks on the button. The program then displays in the label the (first) index of the letter "e". The program shows in the label -1 if the letter e does not occur in the entered text.
Program the above user requirement.
Create a second project within your solution and on the form again put a Textbox, a Label and a Button.
User requirement: the user types any text and presses the button. The program then displays the entered text in the label in the so-called haxor notation.
Program this user requirement.
Haxor notation:
Create a third project within your solution and put a Textbox, two Radiobuttons and a Button on the form. One Radiobutton will be labeled “Male” and the other Radiobutton will be labeled “Female”.
User requirement: the user types his first and last name. For example, "Marietje Jansen." And ticks a radio button with his gender (for example, "Female"). The program then displays a MessageBox with the text "Hello Miss Jansen" or "Hello Mr. Jansen," depending on the text entered and radio button selected.
Note the requirements:
Too easy or need more practice? Then make these extras.
(May 19, 2015 coined by Marcel Veldhuijzen)