#include <string>
#include <iostream>
usingnamespace std;
int main ()
{
cout << "Please enter your first name and age\n";
string first_name;
int age;
cin >> first_name;
cin >> age;
cout << "Hello," <<first_name<< "(age"<<age<<")\n";
return 0;
}
I dont understand how to turn age into months. well...i know how ...but not sure how to pinpoint turning into code?
#include <string>
#include <iostream>
usingnamespace std;
int main ()
{
cout << "Please enter your first name and age\n";
string first_name;
int age;
int ageMonth;
cin >> first_name;
cin >> age;
ageMonth = age * 12;
cout << "Hello," <<first_name<< "(age"<<age<<")\n";
return 0;
}
my failed 2nd attempt:
[code#include <string>
#include <iostream>
using namespace std;
int main ()
{
cout << "Please enter your first name and age\n";
string first_name;
int age;
int ageMonth;
cin >> first_name;
cin >> age;
age <<(ageMonth * 12);
cout << "Hello," <<first_name<< "(age"<<age<<")\n";
return 0;