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

Write a program parameters YourName.cpp to do the following: The program will as

ID: 3656428 • Letter: W

Question


Write a program parameters YourName.cpp to do the following: The program will ask the user name and age The program will display a message like the following Hello, [User's name] You are [User's age] years old. Then the program will ask for two integers The program will display the sum and difference of the two integers. The sum of the two integers is [sum]. The difference of the two integers is [difference]. Define two functions in your program, pick meaningful function names Function one takes user's name and age as inputs, and display a message Function two takes two integers as parameters, and display the sum and difference of the two integers Write function prototypes before main() and the actual function definitions after main(). Ask for values in main(), and then make function calls and pass the values to functions Sample output >./a.out What is your name? John Doe How old are you? 21 Hello, John Doe You are 21 years old. Enter two integers: 20 13 The sum of the two integers is 33. The difference of the two integers is 7.

Explanation / Answer

#include #include using namespace std; void DisplayNameAge(string,string, int); void DisplaySumDiff(int,int); int main(){ //declare variables string firstName,lastName; int age; int intA; int intB; //ask for input coutfirstName>>lastName; coutage; //output data DisplayNameAge(firstName,lastName,age); //ask for two integers coutintA>>intB; //output two integers sum and difference DisplaySumDiff(intA,intB); cin.get();cin.get();//get 2 key input (stalls console from closing) return 0; } void DisplayNameAge(string firstName, string lastName, int age){ cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote