This is a practice problem for my test, I watched a bunch of videos and tutorials about functions and I still don't understand how to do this. Can anyone help program this and explain to me how you did it or get me started atleast? I just dont understand it
Create a function letterToInt with the following interface:
int letterToInt( char letter )
This function should accept a character value as a parameter. This variable represents one symbol in a roman numeral. Your function should return the integer equivalent (e.g., if you pass the function an 'X', it would return the number 10). The function should return -1 if the letter passed to it is not a valid letter in a roman numeral.
• Use a switch statement in your function.
• Your function should contain only one return statement.
Write a main() function to test your function.
The valid roman numerals and their meanings are:
I - 1
V - 5
X - 10
L - 50
C - 100
M - 1000
NOTE: This function does not need to handle a complete roman number such XIV; it only handles one digit.