Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a function that returns the order of a character in the alphabet ( e . g . , its position ) . Letter A
Write a function that returns the order of a character in the alphabet eg its position Letter A is is is dotsZ is The function accepts a character ch and returns its position in the alphabet. NOTE that the Ifunction should return the same order regardless of upper or lower case. SoA and a both should return
An easy way to do this is to remember that characters are represented by numerical code. So the letter has a number associated with it Thus ch A would return if ch is A if it was B etc. Remember to do the appropriate computation for both upper and lower case letters.
Examples:
charPosition
charPosition
charPosition
Your Answer:
public int charPositionchar ch
f
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started