Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

please see photo below Write a program that contains three functions: printLine(

ID: 3540294 • Letter: P

Question

please see photo below


Write a program that contains three functions: printLine(), printSentence() and getNameQ. The printLine function uses the cout object to print two lines of The printSentence function uses the cout object to print one line of "Happy Birthday to you." The getName function gets and returns a first name entered by the user. Call these three functions in the main function to produce the following output: Happy Birthday to you.Happy Birthday to you.Happy Birthday, dear .Happy Birthday to you.

Explanation / Answer

/* SAMPLE OUTPUT
****************************************************
****************************************************
****************************************************
****************************************************
Happy Birthday to you.
Happy Birthday to you.
Happy Birthday, dear aswani.
Happy Birthday to you.
****************************************************
****************************************************
****************************************************
****************************************************
*/

#include<iostream>
using namespace std;
void printLine()
{
for(int i=0; i<2; i++)
cout << "****************************************************"<<endl;
}
void printSentence()
{
cout << "Happy Birthday to you. "<< endl;
}
string getName()
{
string name;
cin >> name;
return name;
}

int main()
{
printLine();
printLine();
printSentence();
printSentence();
cout << "Happy Birthday, dear " << getName() << "." << endl;
printSentence();
printLine();
printLine();
return 0;
}