
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Please code using C++ and only use header <iostream>. Any other headers will not be accpeted. Thank you!

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.

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
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
- Write a c# function that calculates body mass index. This function should accept weight and height values and return body mass index. The body mass index formula is given below: Form1 Weight: weight Body Mass Index = height? Height: After that, you should call the function you defined in the btnCalculate click event. Finally, you should show index value and status in the listBox named as IstResults. Status is calculated according to the table given below: Body Mass Index Calculate IstResults Status 0-18 Weak 19-25 Normal 26-30 Fat Obese >30 Name of tools are lblWeight, IblHeight, numWeight, numHeight, btnCalculate. IstResults.arrow_forwardCreate a flowchart for the C++ code below #include <iostream> using namespace std; int main () { int first_opt, area_opt, perimeter_opt, length, width, radius, side, height, base, a, b, c, A_Rect, A_Square, P_Rect, P_Square, P_Triangle; float A_Circle, A_Triangle, P_Circle; cout<<"Welcome!. Choose what you want to solve"<<"\n"; cout<<"1. AREA"<<"\n"; cout<<"2. PERIMETER"<<"\n"; cin>>first_opt; cout<<"Choose from the following"<<"\n"; switch(first_opt) { case 1: cout<<"1. Area of the Rectangle"<<"\n"; cout<<"2. Area of the Circle"<<"\n"; cout<<"3. Area of the Square"<<"\n"; cout<<"4. Area of the Triangle"<<"\n"; cin>>area_opt; switch(area_opt) { case 1: cout<<"Enter length: "<<"\n"; cin>>length; cout<<"Enter width: "<<"\n"; cin>>width; A_Rect = length*width; cout<<"The area of the rectangle is:…arrow_forwardWrite a C code. You should use scanf() and use printf to show the values that you have assigned. The structure type must have following information:Name of structure: city_pComponents of structure:Name (name of the city)Population (number of people in the city)In_California (is the city inside California or not)Speed_limit (usual speed limit inside the city)arrow_forward
- can we dont use #include<iostream>arrow_forwardWhich of the following regarding R-values in C++17 is/are true? Select all that apply. Pick ONE OR MORE options Integer literals and string literals are both natively R-values An R-value can be passed to a function that accepts a constant L-value reference, but not to a function that accepts a non-constant L-value reference Any time two ampersands (&&) appear in syntactically valid C++17 code, they indicate the presence of an R-value reference For a given type ~T~, constructing an instance of ~T~ from an R-value reference is always strictly more efficient than constructing an instance of ~T~ from an L-value reference It is possible to restrict a class's custom call operator such that it may only be used on instances of the type that are R- value referencesarrow_forwardHello, I am having trouble with this code in c++ for my advance data structure course . I am using the onlinegdb.com complier and get this small issue. I have provided both the snip of the result as well as the code. main.cpp #include<iostream>#include"Student.h"#include<iostream>#include "Student.h"#include "Faculty.h"using namespace std; int main(){ Student std("John","Smith",3.75,"Spring 2019"); Faculty faculty("Mary","Smith","2019"); cout<<"===========================================\n"; faculty.Print(); cout<<"===========================================\n"; cout<<"\n\n\n"; cout<<"===========================================\n"; std.Print(); cout<<"===========================================\n"; return 0;} Person.h ifndef PERSON_H#define PERSON_H#include<iostream>#include<string>using namespace std;class Person{private: int personID; string firstName; string lastName;public: Person(string fName,…arrow_forward
- Without using any string literal notation, how do you create the C++ statement that manually creates a null-terminated C-style string as an array of characters. Use the string “Sampson” as your example. Which element is stored in the base address of the array?arrow_forwardplease look at the screenshot instructions to help me create a flowchart of this c++ code ,also you dont need to do the other tasks just help me to create a flowchart regarding the instructions given, thank youarrow_forwardWhich of the following regarding R-values in C++17 is/are true? Select all that apply. Pick ONE OR MORE options Integer literals and string literals are both natively R-values An R-value can be passed to a function that accepts a constant L-value reference, but not to a function that accepts a non-constant L-value reference Any time two ampersands (&&) appear in syntactically valid C++17 code, they indicate the presence of an R-value reference For a given type ~T~, constructing an instance of ~T~ from an R-value reference is always strictly more efficient than constructing an instance of ~T~ from an L-value reference It is possible to restrict a class's custom call operator such that it may only be used on instances of the type that are R- value referencesarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education