SlideShare a Scribd company logo
1 of 1
Download to read offline
Write a program that reads a person’s name in the followingformat: first name, then middle
name or initial, and then lastname. The program then outputs the name in the
followingformat:
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.
Your program should work the same and place a period after themiddle initial even if the
input did not contain a period. Yourprogram should allow for users who give no middle
name or middleinitial. In that case the output, of course, contains no middlename or initial.
For example the input
Mary User
Should produce the output
User, Mary
If you are using C string, assume that each name is at most 20characters long. Alternatively
, use the class string. Hint : Youmay want to use three string variables rather than one large
stringvariable for the input. You may find it easier to not usegetline.

More Related Content

More from licservernoida

Biol 1322 crn (course number)name datebiol 1322 crn (c
Biol 1322   crn (course number)name datebiol 1322 crn (cBiol 1322   crn (course number)name datebiol 1322 crn (c
Biol 1322 crn (course number)name datebiol 1322 crn (clicservernoida
 
Being in the nursing field you will come across many different e
Being in the nursing field you will come across many different eBeing in the nursing field you will come across many different e
Being in the nursing field you will come across many different elicservernoida
 
Assume that chocolate bliss, the fictitious company in the cours
Assume that chocolate bliss, the fictitious company in the coursAssume that chocolate bliss, the fictitious company in the cours
Assume that chocolate bliss, the fictitious company in the courslicservernoida
 
Assignment in this assignment you will start on proposing ideas
Assignment in this assignment you will start on proposing ideasAssignment in this assignment you will start on proposing ideas
Assignment in this assignment you will start on proposing ideaslicservernoida
 
Assignment 1-case study assignment questionplease re
Assignment 1-case study assignment questionplease reAssignment 1-case study assignment questionplease re
Assignment 1-case study assignment questionplease relicservernoida
 
Assignment 1-case study assignment question
Assignment 1-case study assignment question       Assignment 1-case study assignment question
Assignment 1-case study assignment question licservernoida
 
Assignment strategic planning and financial management pre
Assignment strategic planning and financial management preAssignment strategic planning and financial management pre
Assignment strategic planning and financial management prelicservernoida
 
Assignment 1 supply and demand videoafter reviewing the video you
Assignment 1 supply and demand videoafter reviewing the video youAssignment 1 supply and demand videoafter reviewing the video you
Assignment 1 supply and demand videoafter reviewing the video youlicservernoida
 
Assignment 1 executive memo you are the ceo of a healthcare or
Assignment 1 executive memo you are the ceo of a healthcare orAssignment 1 executive memo you are the ceo of a healthcare or
Assignment 1 executive memo you are the ceo of a healthcare orlicservernoida
 
Assignment 1 (to be submitted through the assignment submiss
Assignment 1 (to be submitted through the assignment submissAssignment 1 (to be submitted through the assignment submiss
Assignment 1 (to be submitted through the assignment submisslicservernoida
 
6 the constitution and the new republic· framing a new governme
6 the constitution and the new republic· framing a new governme6 the constitution and the new republic· framing a new governme
6 the constitution and the new republic· framing a new governmelicservernoida
 
2 the dental hygienists guide tonutritional care
2 the dental hygienists guide tonutritional care2 the dental hygienists guide tonutritional care
2 the dental hygienists guide tonutritional carelicservernoida
 
2 healthcares vulnerability to ransomware attacks by abhilas
2 healthcares vulnerability to ransomware attacks by abhilas2 healthcares vulnerability to ransomware attacks by abhilas
2 healthcares vulnerability to ransomware attacks by abhilaslicservernoida
 
1 tenea lewissocw 6301methodological approach
1 tenea lewissocw 6301methodological approach1 tenea lewissocw 6301methodological approach
1 tenea lewissocw 6301methodological approachlicservernoida
 
1 solitary confinementolen jessiedepartment name, p
1 solitary confinementolen jessiedepartment name, p1 solitary confinementolen jessiedepartment name, p
1 solitary confinementolen jessiedepartment name, plicservernoida
 
1.)what actions and behaviors might a health leader perform to proac
1.)what actions and behaviors might a health leader perform to proac1.)what actions and behaviors might a health leader perform to proac
1.)what actions and behaviors might a health leader perform to proaclicservernoida
 
1.  a family is gathered around in the icu waiting room to monitor t
1.  a family is gathered around in the icu waiting room to monitor t1.  a family is gathered around in the icu waiting room to monitor t
1.  a family is gathered around in the icu waiting room to monitor tlicservernoida
 
1. the writer has used a letter ing system to describe the
1. the writer has used a letter ing system to  describe the 1. the writer has used a letter ing system to  describe the
1. the writer has used a letter ing system to describe the licservernoida
 
1. for this assignment, i want you to pick a popular song (aim to
1. for this assignment, i want you to pick a popular song (aim to 1. for this assignment, i want you to pick a popular song (aim to
1. for this assignment, i want you to pick a popular song (aim to licservernoida
 
1. considering the information provided in the case study, do you
1. considering the information provided in the case study, do you 1. considering the information provided in the case study, do you
1. considering the information provided in the case study, do you licservernoida
 

More from licservernoida (20)

Biol 1322 crn (course number)name datebiol 1322 crn (c
Biol 1322   crn (course number)name datebiol 1322 crn (cBiol 1322   crn (course number)name datebiol 1322 crn (c
Biol 1322 crn (course number)name datebiol 1322 crn (c
 
Being in the nursing field you will come across many different e
Being in the nursing field you will come across many different eBeing in the nursing field you will come across many different e
Being in the nursing field you will come across many different e
 
Assume that chocolate bliss, the fictitious company in the cours
Assume that chocolate bliss, the fictitious company in the coursAssume that chocolate bliss, the fictitious company in the cours
Assume that chocolate bliss, the fictitious company in the cours
 
Assignment in this assignment you will start on proposing ideas
Assignment in this assignment you will start on proposing ideasAssignment in this assignment you will start on proposing ideas
Assignment in this assignment you will start on proposing ideas
 
Assignment 1-case study assignment questionplease re
Assignment 1-case study assignment questionplease reAssignment 1-case study assignment questionplease re
Assignment 1-case study assignment questionplease re
 
Assignment 1-case study assignment question
Assignment 1-case study assignment question       Assignment 1-case study assignment question
Assignment 1-case study assignment question
 
Assignment strategic planning and financial management pre
Assignment strategic planning and financial management preAssignment strategic planning and financial management pre
Assignment strategic planning and financial management pre
 
Assignment 1 supply and demand videoafter reviewing the video you
Assignment 1 supply and demand videoafter reviewing the video youAssignment 1 supply and demand videoafter reviewing the video you
Assignment 1 supply and demand videoafter reviewing the video you
 
Assignment 1 executive memo you are the ceo of a healthcare or
Assignment 1 executive memo you are the ceo of a healthcare orAssignment 1 executive memo you are the ceo of a healthcare or
Assignment 1 executive memo you are the ceo of a healthcare or
 
Assignment 1 (to be submitted through the assignment submiss
Assignment 1 (to be submitted through the assignment submissAssignment 1 (to be submitted through the assignment submiss
Assignment 1 (to be submitted through the assignment submiss
 
6 the constitution and the new republic· framing a new governme
6 the constitution and the new republic· framing a new governme6 the constitution and the new republic· framing a new governme
6 the constitution and the new republic· framing a new governme
 
2 the dental hygienists guide tonutritional care
2 the dental hygienists guide tonutritional care2 the dental hygienists guide tonutritional care
2 the dental hygienists guide tonutritional care
 
2 healthcares vulnerability to ransomware attacks by abhilas
2 healthcares vulnerability to ransomware attacks by abhilas2 healthcares vulnerability to ransomware attacks by abhilas
2 healthcares vulnerability to ransomware attacks by abhilas
 
1 tenea lewissocw 6301methodological approach
1 tenea lewissocw 6301methodological approach1 tenea lewissocw 6301methodological approach
1 tenea lewissocw 6301methodological approach
 
1 solitary confinementolen jessiedepartment name, p
1 solitary confinementolen jessiedepartment name, p1 solitary confinementolen jessiedepartment name, p
1 solitary confinementolen jessiedepartment name, p
 
1.)what actions and behaviors might a health leader perform to proac
1.)what actions and behaviors might a health leader perform to proac1.)what actions and behaviors might a health leader perform to proac
1.)what actions and behaviors might a health leader perform to proac
 
1.  a family is gathered around in the icu waiting room to monitor t
1.  a family is gathered around in the icu waiting room to monitor t1.  a family is gathered around in the icu waiting room to monitor t
1.  a family is gathered around in the icu waiting room to monitor t
 
1. the writer has used a letter ing system to describe the
1. the writer has used a letter ing system to  describe the 1. the writer has used a letter ing system to  describe the
1. the writer has used a letter ing system to describe the
 
1. for this assignment, i want you to pick a popular song (aim to
1. for this assignment, i want you to pick a popular song (aim to 1. for this assignment, i want you to pick a popular song (aim to
1. for this assignment, i want you to pick a popular song (aim to
 
1. considering the information provided in the case study, do you
1. considering the information provided in the case study, do you 1. considering the information provided in the case study, do you
1. considering the information provided in the case study, do you
 

Recently uploaded

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 

Recently uploaded (20)

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

name or initial, and then lastname. The program then outputs the name in the followingformat:

  • 1. Write a program that reads a person’s name in the followingformat: first name, then middle name or initial, and then lastname. The program then outputs the name in the followingformat: 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. Your program should work the same and place a period after themiddle initial even if the input did not contain a period. Yourprogram should allow for users who give no middle name or middleinitial. In that case the output, of course, contains no middlename or initial. For example the input Mary User Should produce the output User, Mary If you are using C string, assume that each name is at most 20characters long. Alternatively , use the class string. Hint : Youmay want to use three string variables rather than one large stringvariable for the input. You may find it easier to not usegetline.