Computer Programming I :: Projects :: Verb Conjugator
Department Connections: World Languages
Problem
Create a program that takes a given Spanish verb and conjugates the verb into its present-tense forms. For the sake of this project, you do not have to worry about special cases. The present tense of Spanish verbs depends on the last two letters of the verb as shown below:
Verbs Ending in -ar
Subject | New Ending |
Yo | -o |
Tú | -as |
Usted | -a |
Él/Ella | -a |
Nostros | -amos |
Vosotros | -áis |
Ustedes | -an |
Ellos/Ellas | -an |
Verbs Ending in -er
Subject | New Ending |
Yo | -o |
Tú | -es |
Usted | -e |
Él/Ella | -e |
Nostros | -emos |
Vosotros | -éis |
Ustedes | -en |
Ellos/Ellas | -en |
Verbs Ending in -ir
Subject | New Ending |
Yo | -o |
Tú | -es |
Usted | -e |
Él/Ella | -e |
Nostros | -imos |
Vosotros | -ís |
Ustedes | -en |
Ellos/Ellas | -en |
Specific Requirements
- Store the new endings in three arrays (one array for each original ending).
- You should also store the eight labels that you will use to display the conjugated verb in an array.
- Use the substring method to determine what ending the verb has.
- If the word typed doesn't end in ar, er, or ir, return a message saying it isn't a valid verb.
- Use an if statement to determine the correct ending and use a for loop within the if statement to process the verb and display each form in the correct label.
- Determine a good name for each variable following the rules.
- Rename the form and all controls on the form using a three-letter prefix.
- Add a comment header following class guidelines.
Project Extension
- Make it so your program can handle irregular verbs and stem-changing verbs.
- Use a language other than Spanish. It is easiest if you stick to a romance language such as French, Italian, or Latin.
Tips
- You will need to determine the ending of the word by getting the last two letters as well as everything before those last two letters. You will need to use substring two separate times to do this.