letter to an eight-digit number. The check letter should be computed as follows: Break the number up into 4 two-digit numbers. Add the four numbers together. Find the remainder after division by 26. The check letter is the letter in the alphabet that corresponds to the number just computed. (A=0, B=1, C=2, etc.) Print the original number followed by the check letter. Use at least one function that returns a value when you write this program.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
100%

Please use C++ language and only use the <iostream> library. Thank you!

 

5: CheckLetter.cpp) Write a program that adds a check
letter to an eight-digit number. The check letter should be
computed as follows: Break the number up into 4 two-digit
numbers. Add the four numbers together. Find the
remainder after division by 26. The check letter is the letter
in the alphabet that corresponds to the number just
computed. (A=0, B=1, C=2, etc.) Print the original number
followed by the check letter. Use at least one function that
returns a value when you write this program.
Transcribed Image Text:5: CheckLetter.cpp) Write a program that adds a check letter to an eight-digit number. The check letter should be computed as follows: Break the number up into 4 two-digit numbers. Add the four numbers together. Find the remainder after division by 26. The check letter is the letter in the alphabet that corresponds to the number just computed. (A=0, B=1, C=2, etc.) Print the original number followed by the check letter. Use at least one function that returns a value when you write this program.
More on functions: checkLetter.cpp
Main program:
1) read number
2) call function
Finding the remainder
after division by 26 is
the mod operator,“%".
Function:
1) break number into four 2-digit numbers
2) add numbers together
3) divide by 26 to find remainder
4) return to main program
3) convert remainder from function to a letter
4) print original number followed by letter
Part of this assignment is to use a function that returns a value. My suggestion is to have
the main program read the number, have the function add the four two-digit numbers
together and compute the remainder, and then have the main program find and print the
corresponding letter.
Transcribed Image Text:More on functions: checkLetter.cpp Main program: 1) read number 2) call function Finding the remainder after division by 26 is the mod operator,“%". Function: 1) break number into four 2-digit numbers 2) add numbers together 3) divide by 26 to find remainder 4) return to main program 3) convert remainder from function to a letter 4) print original number followed by letter Part of this assignment is to use a function that returns a value. My suggestion is to have the main program read the number, have the function add the four two-digit numbers together and compute the remainder, and then have the main program find and print the corresponding letter.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Concept of Flowchart
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++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning