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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education