Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use c++ and explain code. thanks Question 5: Write a program that reads a person's name in the following format: first name, then middle name

image text in transcribed

use c++ and explain code. thanks

Question 5: Write a program that reads a person's name in the following format: first name, then middle name or initial, and then last name. The program then outputs the name in the following format: Last_Name, First_Name Middle_Initial. For example, the input Mary Average User should produce the output: User, Mary A. The input Mary A. User should also produce the output: User, Mary A. Note that your program should work the same and place a period after the middle initial even if the input did not contain a period. Hint: You may want to use three string variables rather than one large string variable for the input. You may find it easier to not use getline. Question 6: Write a program that reads in a line of text and outputs the line with all the digits in all integer numbers replaced with 'x'. Please enter a line of text: My userID is john17 and my 4 digit pin is 1234 which is secret My userID is john17 and my x digit pin is xxxx which is secret Notes: 1. If a digits is part of a word, then the digit is not changed to an 'x'. For example, john17 is NOT changed to johnxx. 2. You may assume that the text entered by the user will contain only letters (upper case or lower case), digits and spaces. 3. Think how to break down your implementation to functions

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. What could have been done to prevent this situation?

Answered: 1 week ago

Question

Guidelines for Informative Speeches?

Answered: 1 week ago