Problem 5 Solve this problem inside the files problems-library.c and problem5-library.h. Do not modify any other files for this problem. Write a function called "nextLetter" inside problems-library.c and add its prototype inside problem5-library.h. . The function must accept 2 parameters, a character then an integer. • It will return a character. • The function will return the character that is reached by starting from the passed letter and moving steps equal to the passed integer. Check the examples below: Example: If the parameters were 'A' and 1, the function will return 'B', because 'B' is 1 step away from 'A'. Example: If the parameters were 'e' and 3, the function will return 'h', because 'h' is 3 steps away from 'e'. . If the given letter is uppercase, the returned letter must be uppercase. If the given letter is lowercase, the returned letter must be lowercase. • If the given integer is too big or will cause the letters to reach the last letter, you must restart the letters from the beginning of the alphabet - but in the same letter case. Check the examples below: Example: If the parameters were "X" and 5, the function will return 'C', because the function will use 2 of the 5 steps to move from 'X' to 'Z', but since 'Z' is the last letter of the alphabet, any extra steps will cause the letters will be 'A', 'B', and 'C', and therefore the function returns 'C'. Example: If the parameters were 't' and 10, the function will return 'd'. Similar to the above example, the alphabet will end after 6 steps and will restart from . The main function is already written for you inside problems.c, take a look at it but do not modify it. and move the remaining steps until it reaches 'd'. restart from 'A'. So the remaining 3 steps

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter11: Introduction To Classes
Section11.3: Adding Class Functions
Problem 8E
icon
Related questions
Question
Problem 5
Solve this problem inside the files problem5-library.c and problem5-library.h. Do not modify any other files for this problem.
Write a function called "nextLetter" inside problem5-library.c and add its prototype inside problem5-library.h.
• The function must accept 2 parameters, a character then an integer.
It will return a character.
• The function will return the character that is reached by starting from the passed letter and moving steps equal to the passed integer. Check the examples below:
Example: If the parameters were 'A' and 1, the function will return 'B', because 'B' is 1 step away from 'A'.
Example: If the parameters were 'e' and 3, the function will return 'h', because 'h' is 3 steps away from 'e'.
• If the given letter is uppercase, the returned letter must be uppercase. If the given letter is lowercase, the returned letter must be lowercase.
• If the given integer is too big or will cause the letters to reach the last letter, you must restart the letters from the beginning of the alphabet - but in the same letter case. Check the examples below:
Example: If the parameters were 'X' and 5, the function will return 'C', because the function will use 2 of the 5 steps to move from 'X' to 'Z', but since 'Z' is the last letter of the alphabet, any extra steps will cause the letters to restart from 'A'. So the remaining 3 steps
will be 'A', 'B', and 'C', and therefore the function returns 'C'.
Example: If the parameters were 't' and 10, the function will return 'd'. Similar to the above example, the alphabet will end after 6 steps and will restart from 'a' and move the remaining steps until it reaches 'd'.
• The main function is already written for you inside problem5.c, take a look at it but do not modify it.
Transcribed Image Text:Problem 5 Solve this problem inside the files problem5-library.c and problem5-library.h. Do not modify any other files for this problem. Write a function called "nextLetter" inside problem5-library.c and add its prototype inside problem5-library.h. • The function must accept 2 parameters, a character then an integer. It will return a character. • The function will return the character that is reached by starting from the passed letter and moving steps equal to the passed integer. Check the examples below: Example: If the parameters were 'A' and 1, the function will return 'B', because 'B' is 1 step away from 'A'. Example: If the parameters were 'e' and 3, the function will return 'h', because 'h' is 3 steps away from 'e'. • If the given letter is uppercase, the returned letter must be uppercase. If the given letter is lowercase, the returned letter must be lowercase. • If the given integer is too big or will cause the letters to reach the last letter, you must restart the letters from the beginning of the alphabet - but in the same letter case. Check the examples below: Example: If the parameters were 'X' and 5, the function will return 'C', because the function will use 2 of the 5 steps to move from 'X' to 'Z', but since 'Z' is the last letter of the alphabet, any extra steps will cause the letters to restart from 'A'. So the remaining 3 steps will be 'A', 'B', and 'C', and therefore the function returns 'C'. Example: If the parameters were 't' and 10, the function will return 'd'. Similar to the above example, the alphabet will end after 6 steps and will restart from 'a' and move the remaining steps until it reaches 'd'. • The main function is already written for you inside problem5.c, take a look at it but do not modify it.
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning