lmayer@elgin.edu

lab3

Extracting Characters from a String

Purpose of assignment: To give students experience using the String Functions Left$, LEN and RIGHT$.

Write a program that will input a word from the user, then

  • extract the first letter of the word
  • extract the last letter of the word
  • find the length of the word

Remember to

  • write an algorithm for the program before you start the code
  • Use comments to add your name to the program, identify the program and describe what it does
  • Use PRINT statements at the beginning of the program to identify your output

Use the following words as test data:

  • woodchuck
  • program
  • animation

The output should look something like:

Program: Extracting Characters from a string
Written by: Your Name

The word is: woodchuck
The first letter of the word is: w
The last letter of the word is: k
The number of letters in the word is: 9