Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that produces the output shown, basod on the following information. OUTPUT Enter your firat and middle namen Tommy Boy Enter your lant
Write a program that produces the output shown, basod on the following information. OUTPUT Enter your firat and middle namen Tommy Boy Enter your lant name Da Vinc How i0 your love life Tommy Boy Da Vinci? By the way, your full name han 18 characters. Enter your friend'o full name: Tiger How io Tiger Wooda love 1ife Tommy Boy? By the way, your friend'a full name han 11 charactere. Press any key to continue. The purpose of this exercise is to provide practice working with strings, c strings and c string functions. Therefore, no functions are used in this program. Declare 4 variables: 3.) Declare a c string of size 20 and name it: firstAndMiddle 4.) Declare a c string of size 20 and name it: lastName 5.) Declare a c string of size 40 and name it: fulIName 6.) Declare a string variable and name it: friendsName 7.) Prompt the user to enter first and middle names. (see outut) Read in the first and middle names into firstAndMiddle Note: firstAndMiddle is a c_string, so do you use getline0 or cin.getline0? 8.) Prompt the user to enter a last name. (see outut) Read in the last name into lastName 9.) Use the strcpy and strcat () functions to assign a full name to the variable fullName For example if firstName holds Tom, and lastName holds Lee, then after using these functions, fullName should hold Tom Lee (with a space between the names)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started