Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Some common functions that take a char as input and use a switch statement are:

  1. toUpperCase(char c): This function takes a lowercase char as input and returns its uppercase equivalent using a switch statement.

  2. toLowerCase(char c): This function takes an uppercase char as input and returns its lowercase equivalent using a switch statement.

  3. isVowel(char c): This function takes a char as input and returns true if the char is a vowel (a, e, i, o, u) using a switch statement.

  4. calculate(char operator, double num1, double num2): This function takes a char as input to represent a mathematical operator (+, -, *, /) and two numbers (num1 and num2). It returns the result of performing the specified operation on the given numbers using a switch statement.

  5. monthName(char month): This function takes a char as input to represent a month (J for January, F for February, etc.) and returns the full name of the month using a switch statement.