Page 1 of 1

3. At a gift shop, customers can choose to print their names on a small keyring. The maximum number of letters that can

Posted: Wed Apr 27, 2022 3:40 pm
by answerhappygod
3 At A Gift Shop Customers Can Choose To Print Their Names On A Small Keyring The Maximum Number Of Letters That Can 1
3 At A Gift Shop Customers Can Choose To Print Their Names On A Small Keyring The Maximum Number Of Letters That Can 1 (98.15 KiB) Viewed 33 times
3. At a gift shop, customers can choose to print their names on a small keyring. The maximum number of letters that can fit on the keyring is 12, including the space between the first and last name. The store assumes the maximum length of both first name and last name is 10 letters each. Write a C++ program that 1. Asks the customer to input their first and last names 2. Checks if the full name (including a space in the middle) can fit on the keyring a. If it doesn't fit tell the user it's too long then ask for the name again b. If it fits, concatenate the two names into one c-string to be printed, then confirm the name to the user Hints: use strlen (c) to find the length of a string use sirsky (a, b) to copy string b to string a use strcat (a, b) to concatenate strings a and b and store the result in string a . . . Sample Output Enter your first name > Monsieur Enter your last name > Potatoes Sorry, that name is too long. Perhaps you can enter your initials? Enter your first name > Mister Enter your last name > Potatoes Sorry, that name is too long. Perhaps you can enter your initials? Enter your first name > M. Enter your last name Potatoes Your keyring will have the name "M. Potatoes" printed on it