Problem : Write a program that contains three functions: printLine(), printSente
ID: 666332 • Letter: P
Question
Problem: Write a program that contains three functions: printLine(), printSentence() and getName(). 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 <someone's name>.
Happy Birthday to you.
*************************************************
*************************************************
*************************************************
*************************************************
Explanation / Answer
Above programm could be written in C++ programming.
Void main()
for (int k = 0; k< 4; k++){
printLine ();
}
for (int k = 0; k < 2; k++){
printSentence();
}
print1stHalfSentence();
getName();
print2ndHalfSentence();
printSentence();
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.