-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.cpp
More file actions
35 lines (35 loc) · 931 Bytes
/
hello.cpp
File metadata and controls
35 lines (35 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include<iostream>
#include<string>
using namespace std;
int main()
{
cout << "Please enter your first name: ";
string first_name;
cin >> first_name;
cout << "Dear, " << first_name;
cout << "\nHow are you, personally I am fine?\n";
string friend_name;
cout << "Tell me the name of a friend: ";
cin >> friend_name;
cout << "Have you seen " << friend_name << " lately? Please answer with t or f: ";
char seen_friend;
cin >> seen_friend;
if (seen_friend == 'f') {
cout << "You need to talk to " << friend_name << " more!\n";
}
if (seen_friend == 't') {
char friend_gender;
cout << "Is your friend male, female or neither. Please put m for male, f for female, or n for neither: ";
cin >> friend_gender;
if (friend_gender == 'm') {
cout << "Tell him I said hi!\n";
}
else if (friend_gender == 'f') {
cout << "Tell her I said hi!\n";
}
else {
cout << "Tell them I said hi!\n";
}
}
return 0;
}