Question: #include #include using namespace std; /* Your name, Alexander Bernal email, abernal20@cnm.edu and program name go here */ /* There are 3 errors in the
#include
#include
using namespace std;
/*
Your name, Alexander Bernal
email, abernal20@cnm.edu
and program name go here
*/
/*
There are 3 errors in the code below.
Please find and fix the errors.
Put your initials and a comment and what you fixed.
*/
int AskForAge();
string AskForName();
void PrintInfo(int age, string name);
int main()
{
int age;
string name;
age = AskForAge();
AskForName();
PrintInfo();
return 0;
}
int AskForAge()
{
int age;
cout << "Please enter your age: ";
cin >> age;
cin.ignore();
}
string AskForName()
{
string name;
cout << "Please enter your name: ";
getline(cin, name);
return name;
}
void PrintInfo(int age, string name)
{
cout << "Your name is " << name << "and you are " << age << "years old. ";
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
