Classification of characters (2) P58653


Statement
 

pdf   zip

thehtml

Write a program that reads a character and tells if it is a letter, if it is a vowel, if it is a consonant, if it is an uppercase letter, if it is a lowercase letter and if it is a digit.

For your comodity when solving this exercise, use the procedure

void print_line(char c, string s, bool b) { cout << s << "('" << c << "') = "; if (b) cout << "true" << endl; else cout << "false" << endl; }

that prints in a line if the character c is an s or not, depending on the boolean b. For instance, the call print_line(’J’, "letter", true); prints the first line of the first sample output.

Input

Input consists of a printable character, like a letter, or a digit, or a punctuation mark.

Output

Tell if the given character is a letter, a vowel, a consonant, an uppercase letter, a lowercase letter and a digit, following the format of the examples.

Public test cases
  • Input

    J
    

    Output

    letter('J') = true
    vowel('J') = false
    consonant('J') = true
    uppercase('J') = true
    lowercase('J') = false
    digit('J') = false
    
  • Input

    6
    

    Output

    letter('6') = false
    vowel('6') = false
    consonant('6') = false
    uppercase('6') = false
    lowercase('6') = false
    digit('6') = true
    
  • Input

    .
    

    Output

    letter('.') = false
    vowel('.') = false
    consonant('.') = false
    uppercase('.') = false
    lowercase('.') = false
    digit('.') = false
    
  • Information
    Author
    Jordi Petit
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Pascal Python
    User solutions
    C C++ Java Python