PROBLEM: Write a program that prompts the user to input first name, middle initial, and last name (in upper case) for an ID card. There is a 22-character limit that also includes spaces in between the names on the ID card. The following conditions/limitations are observed: A. If the first name, second name, middle initial, and last name exceed the character limit, use the first name initial and last name. B. If the last name's character count is greater than or equal to the character limit, omit the second name and middle initial. Use the first name initial and truncate the last name to fit the character limit. C. The spaces in between the first name, second name, middle initial, and last name should not be included in the input. D. If there is no second name or middle initial, input 0. E. Omit any space in the last name, e.g., DE GUZMAN will be DEGUZMAN. SPECIFICATIONS: - You may only use the codes that we studied under our lectures - All lines of codes should have a comment. - Save your cpp file as Surname - PE (Example: Pangaliman - PE.cpp) TEST CASES: If a user inputs a whole name with less than or equal to 22 characters, RIC JOSEPHA. BALOG: Enter first name: RIC Enter second name: JOSEPH

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
PROBLEM:
Write a program that prompts the user to input first name, middle initial, and last name (in upper case) for an ID card. There is a 22-character
limit that also includes spaces in between the names on the ID card. The following conditions/limitations are observed:
A. If the first name, second name, middle initial, and last name exceed the character limit, use the first name initial and last name.
B. If the last name's character count is greater than or equal to the character limit, omit the second name and middle initial. Use the first
name initial and truncate the last name to fit the character limit.
C. The spaces in between the first name, second name, middle initial, and last name should not be included in the input.
D. If there is no second name or middle initial, input 0.
E. Omit any space in the last name, e.g., DE GUZMAN will be DEGUZMAN.
SPECIFICATIONS:
- You may only use the codes that we studied under our lectures
- All lines of codes should have a comment.
- Save your cpp file as Surname - PE (Example: Pangaliman - PE.cpp)
TEST CASES:
If a user inputs a whole name with less than or equal to 22 characters, RIC JOSEPHA. BALOG:
Enter first name: RIC
Enter second name: JOSEPH
Enter middle initial: A
Transcribed Image Text:PROBLEM: Write a program that prompts the user to input first name, middle initial, and last name (in upper case) for an ID card. There is a 22-character limit that also includes spaces in between the names on the ID card. The following conditions/limitations are observed: A. If the first name, second name, middle initial, and last name exceed the character limit, use the first name initial and last name. B. If the last name's character count is greater than or equal to the character limit, omit the second name and middle initial. Use the first name initial and truncate the last name to fit the character limit. C. The spaces in between the first name, second name, middle initial, and last name should not be included in the input. D. If there is no second name or middle initial, input 0. E. Omit any space in the last name, e.g., DE GUZMAN will be DEGUZMAN. SPECIFICATIONS: - You may only use the codes that we studied under our lectures - All lines of codes should have a comment. - Save your cpp file as Surname - PE (Example: Pangaliman - PE.cpp) TEST CASES: If a user inputs a whole name with less than or equal to 22 characters, RIC JOSEPHA. BALOG: Enter first name: RIC Enter second name: JOSEPH Enter middle initial: A
TEST CASES:
If a user inputs a whole name with less than or equal to 22 characters, RIC JOSEPH A. BALOG:
Enter first name: RIC
Enter second name: JOSEPH
Enter middle initial: A
Enter last name: BALOG
Result: RIC JOSEPH A BALOG
If a user inputs a whole name with more than 22 characters. RIANNA CAMILLE G. VENTURA:
Enter first name: RIANNA
Enter second name: CAMILLE
Enter middle initial: G
Enter last name: VENTURA
Result: R VENTURA
Transcribed Image Text:TEST CASES: If a user inputs a whole name with less than or equal to 22 characters, RIC JOSEPH A. BALOG: Enter first name: RIC Enter second name: JOSEPH Enter middle initial: A Enter last name: BALOG Result: RIC JOSEPH A BALOG If a user inputs a whole name with more than 22 characters. RIANNA CAMILLE G. VENTURA: Enter first name: RIANNA Enter second name: CAMILLE Enter middle initial: G Enter last name: VENTURA Result: R VENTURA
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY