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.

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

Please code using C++ and only use header <iostream>. Any other headers will not be accpeted. Thank you!

### CheckLetter.cpp

**Objective:**
Develop a program to append a check letter to an eight-digit number. This check letter acts as an identifier based on computed values from the original number.

**Steps to Compute the Check Letter:**

1. **Divide the Number:** 
   - Break the eight-digit number into four two-digit segments.

2. **Sum the Segments:** 
   - Add these four two-digit numbers together to get a single total sum.

3. **Modulo Operation:**
   - Calculate the remainder of this sum when divided by 26.

4. **Assign the Alphabetical Letter:**
   - Convert the resulting remainder to a corresponding letter in the alphabet where:
     - A = 0
     - B = 1
     - C = 2
     - ...so on until Z = 25

5. **Output:**
   - Display the original eight-digit number followed by the computed check letter.

**Programming Requirement:**

- Implement at least one function that returns a value within this program. This function should ideally handle either the summation or the modulo conversion to enhance modularity and code readability. 

By following this procedure, the program will successfully compute and append a check letter to any given eight-digit number as specified.
Transcribed Image Text:### CheckLetter.cpp **Objective:** Develop a program to append a check letter to an eight-digit number. This check letter acts as an identifier based on computed values from the original number. **Steps to Compute the Check Letter:** 1. **Divide the Number:** - Break the eight-digit number into four two-digit segments. 2. **Sum the Segments:** - Add these four two-digit numbers together to get a single total sum. 3. **Modulo Operation:** - Calculate the remainder of this sum when divided by 26. 4. **Assign the Alphabetical Letter:** - Convert the resulting remainder to a corresponding letter in the alphabet where: - A = 0 - B = 1 - C = 2 - ...so on until Z = 25 5. **Output:** - Display the original eight-digit number followed by the computed check letter. **Programming Requirement:** - Implement at least one function that returns a value within this program. This function should ideally handle either the summation or the modulo conversion to enhance modularity and code readability. By following this procedure, the program will successfully compute and append a check letter to any given eight-digit number as specified.
**Educational Content: Functions in C++ Programming - checkLetter.cpp**

In this lesson, we'll explore the use of functions within a C++ program, specifically focusing on the `checkLetter.cpp` example.

### Main Program Steps:

1. **Read Number**: Input a number from the user.
2. **Call Function**: Invoke a specific function to process the number.

### Function Details:

1. **Break Number**: Divide the number into four 2-digit segments.
2. **Add Numbers**: Calculate the sum of these segments.
3. **Divide by 26**: Use the remainder operation to find the remainder when this sum is divided by 26. This is done using the mod operator `%`.
4. **Return to Main Program**: Pass the remainder back to the main program.

### Further Steps in Main Program:

3. **Convert Remainder**: Translate the remainder into a corresponding letter.
4. **Print Result**: Output the original number followed by the letter.

### Additional Notes:

A speech bubble and wizard illustration adds a visual element to emphasize the use of the mod operator (`%`) for finding remainders.

**Assignment Guidance:**

For this assignment, you will create a function that returns a value. The recommended approach is:
- Have the main program read the number.
- Use the function to add the four 2-digit numbers together and compute the remainder.
- Finally, the main program should find and print the corresponding letter.

This process will help solidify your understanding of function creation and usage in C++ programming.
Transcribed Image Text:**Educational Content: Functions in C++ Programming - checkLetter.cpp** In this lesson, we'll explore the use of functions within a C++ program, specifically focusing on the `checkLetter.cpp` example. ### Main Program Steps: 1. **Read Number**: Input a number from the user. 2. **Call Function**: Invoke a specific function to process the number. ### Function Details: 1. **Break Number**: Divide the number into four 2-digit segments. 2. **Add Numbers**: Calculate the sum of these segments. 3. **Divide by 26**: Use the remainder operation to find the remainder when this sum is divided by 26. This is done using the mod operator `%`. 4. **Return to Main Program**: Pass the remainder back to the main program. ### Further Steps in Main Program: 3. **Convert Remainder**: Translate the remainder into a corresponding letter. 4. **Print Result**: Output the original number followed by the letter. ### Additional Notes: A speech bubble and wizard illustration adds a visual element to emphasize the use of the mod operator (`%`) for finding remainders. **Assignment Guidance:** For this assignment, you will create a function that returns a value. The recommended approach is: - Have the main program read the number. - Use the function to add the four 2-digit numbers together and compute the remainder. - Finally, the main program should find and print the corresponding letter. This process will help solidify your understanding of function creation and usage in C++ programming.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to Coding
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