" Write a program that reads into a string object a name with three blanks between the first and last names. Then extract the first and last names and store them in separate string objects. Write a function subprogram that displays its string argument two times. Call this function display the first name for times and then to display the last name six times."
I completed coding the first part of this task with the strings and combining strings together. However, i have having trouble with the other half of this task. It begins from "Write a function subprogram .... to display the last name six times." Can anyone help me with this one. This is where i have so far --
#include <iostream>
#include <string>
using namespace std;
// Input and Output
cout << " Please enter your first name: ";
getline ( cin, firstname) ;
cout << " Please enter your last name: ";
getline ( cin, lastname );
wholename = firstname + " " + lastname; // String of first and last join together -- 3 blanks between last and first
cout << greet << wholename << endl; // Display the name with greet + wholename
cout << " You have " << (wholename.length() - 3)
<< " number of letters in your name. " << endl;