i'm making this spanish conjugator for class.
and i cant seem to get how to make multiple letter variables.
can anyone tell my what i'm doing wrong?
it's kinda urgent.

here is the code so far.

#include <iostream>
using namespace std;

int main () {

    char verb;
    cout << "Enter the base of the verb you would like to conjugate" <<endl;
    cin >> verb;
    cout << "Thank you" <<endl;

    char gruppe;
    cout << "is it an ir, er or ar verb?" <<endl;
    cin >> gruppe;
    cout << "Thank you" <<endl;

    char pronomen;
    cout << "now who does it (yo, tú, él, ella, usted, nosotros, vosotros, ellos, ustedes" <<endl;
    cin >> pronomen;
    cout << "thank you" <<endl;

    if (gruppe == 'ir'){
        if (pronomen == 'yo'){
            cout << verb << "o" <<endl;
        if (pronomen == 'tú'){
            cout << verb << "es" <<endl;
        if (pronomen == 'él'){
            cout << verb << "imos" <<endl;
        if (pronomen == 'ella'){
            cout << verb << "imos" <<endl;
        if (pronomen == 'usted'){
            cout << verb << "imos" <<endl;
        if (pronomen == 'nosotros'){
            cout << verb << "ís" <<endl;
        if (pronomen == 'vosotros')
            cout << verb << "en" <<endl;

Edited by mike_2000_17: Fixed formatting

6 Years
Discussion Span
Last Post by corby

1) Please wrap your code in code tags
2) Use std::string instead of char (you'll have to #include <string>) and everything should turn out much better for you :)



its you choice:string or char arrays....but using string is mostly better unless you are checking to make sure the person entered only a specific number of characters like only 2 chars rather than 3....but just go with strings and you should be fine

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.