Answered step by step
Verified Expert Solution
Question
1 Approved Answer
/ * Exercises: 1 . Complete the program below. Sample Run: Hello from main! Hello from the writeMessage function! Write a custom message: Hello! Hello!
Exercises:
Complete the program below.
Sample Run:
Hello from main!
Hello from the writeMessage function!
Write a custom message: Hello!
Hello!
Back in main!
This program prints a message by calling a function.
#include Required for cin and cout
#include Required for string
using namespace std; Required for not having to use std::
Write a message to the console from a function
void writeMessage;
void writeCustomMessagestring message;
The main function
int main
cout "Hello from main!" endl;
TODO: Call the writeMessage function
string customMessage;
cout "Write a custom message: ;
cin customMessage;
TODO: Call the writeCustomMessage function with the customMessage as a parameter
cout "Back in main!" endl;
return ;
The function to write a message
void writeMessage
cout "Hello from the writeMessage function!" endl;
The function to write a custom message
void writeCustomMessagestring message
cout message endl;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started