Answer:
The solution is implemented in python:
numnames = int(input("Number of Names: "))
nametitle = ["Surname: ","Firstname: ","Middlename: ","Middlename 2: "]
names = []
for i in range(numnames):
name = input(nametitle[i])
names.append(name)
print("Your fullname is: ",end=" ")
for i in names:
print(i,end=" ")
Explanation:
This prompts user for number of names
numnames = int(input("Number of Names: "))
This lists the name titles in a list
nametitle = ["Surname: ","Firstname: ","Middlename: ","Middlename 2: "]
This initializes an empty list
names = []
The following for loop get names from the user
<em>for i in range(numnames):</em>
<em> name = input(nametitle[i])</em>
<em> names.append(name)</em>
The following instructions print the user fullnames
<em>print("Your fullname is: ",end=" ")</em>
<em>for i in names:</em>
<em> print(i,end=" ")</em>