/*Exercises: 1. Complete the program below. Sample Run: Hello from main! Hello from the write Message 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 customMessage; // TODO: Call the writeCustomMessage function with the customMessage as a parameter cout << "Back in main!" << endl; return 0; } // The function to write a message void write Message() (cout << "Hello from the write Message function!" << endl; } // The function to write a custom message void having to use std:: // Write a message to the console from a function vold write Message(); void writeCustomMessage(string message); // The main function int main() { cout << "Hello from main!" << endl; // TODO: Call the write Message function string customMessage; cout << "Write a custom message: "; cin > > writeCustomMessage(string message) (cout << message << endl;]
/*Exercises: 1. Complete the program below. Sample Run: Hello from main! Hello from the write Message 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 customMessage; // TODO: Call the writeCustomMessage function with the customMessage as a parameter cout << "Back in main!" << endl; return 0; } // The function to write a message void write Message() (cout << "Hello from the write Message function!" << endl; } // The function to write a custom message void
having to use std:: // Write a message to the console from a function vold write Message(); void writeCustomMessage(string message); // The main function int main() {
cout << "Hello from main!" << endl; // TODO: Call the write Message function string customMessage; cout << "Write a custom message: "; cin > >
writeCustomMessage(string message) (cout << message << endl;]

Step by step
Solved in 3 steps with 2 images









