Question: Write a function to calculate character offsets, throwing exceptions in error conditions. Use a source code management tool as you develop this program. Commit changes
Write a function to calculate character offsets, throwing exceptions in error conditions.
Use a source code management tool as you develop this program. Commit changes frequently using descriptive commit messages. Push your changes to GitHub or other publicly accessible location for your instructor to clone.
Requirements
Write a function according to this prototype:
char characterchar start, int offset;
If start is not a letter AZ az throw an invalidCharacterExcpeption.
If the target is not a letter, throw an invalidRangeException.
Otherwise, return the letter described by the start and offset.
Build a driver in main to test this function and display its output. Use trycatch blocks to call your function with different start and offset values. Use the Sample Output below, or come up with your own test values.
Functions must pass parameters and return values as needed, using only local variables. Global variables are not allowed.
Use comments to document your program as you see fit. Include comments at the beginning of your program with your name, the class with section and the date.
Josh Junior
CIS
January
Submit the URL for your repository to the dropbox. No screen shots are needed.
Sample Output
charactera should return b
charactera should throw an invalidRangeExpection.
characterZ should return Y
character should throw an invalidCharacterExcpeption.
Do not allow upper and lowercase transitions. characterA should throw an exception, not return a
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
