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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
#include <string>
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int updateFriendScore(int);
char responder();
int main()
{
int a = 1, b = 2, c = 3;
int num = 0, FriendScore = 0;
char response = 'Y', foodQ = '0', sportsQ = '0', moviesQ = '0', beverageQ = '0';
cout << "~ Phil's Friendship Algorithm ! ~ " << endl;
cout << "Calling potential friend.." << endl;
cout << "Brrrrring....." << endl;
cout << "Brrrrring....." << endl;
cout << "Brrr...... Hello ?" << endl;
// TRY FOOD
cout << "Hey ! Do you want to get some food? (y/n): " << endl;
foodQ = responder();
if (foodQ == 'Y')
{
cout << "Yay! What do you prefer ?" << "(1-Seafood, 2-steak, or 3-vegetarian)";
cin >> num;
FriendScore += updateFriendScore(num);
cout << "Cool let's grub out . I'll pick you up.";
cout << " Awesome see you in a bit.. friend ;) ! " << endl;
}
if (foodQ != 'N')
{
//TRY SPORTS
cout << "Ok no problem. Do you like sports? (y/n): ";
sportsQ = responder();
}
if (sportsQ == 'Y')
{
cout << "Heck Ya ! Me too ! What do you want to play ?" << "(1-Basketball, 2-Baseball, 3-Football) ";
cin >> num;
FriendScore += updateFriendScore(num);
}
if (sportsQ != 'N')
{
//TRY MOVIES
cout << "Alright. I'm tired anyways. How about a movie ?! (y/n) ";
moviesQ = responder();
}
if ( moviesQ == 'Y' )
{
cout << "Awesome ! What type of movie do you want to see ?" << "(1-Action, 2-Suspense, 3-Romance) ";
cin >> num;
FriendScore += updateFriendScore(num);
cout << "Cool ! See you in a bit ! I'll bring the popcorn ! " << endl;
}
if (moviesQ != 'N')
{
//TRY BEVERAGES
cout << "Ya movie tickets are pretty expensive. How about we get something to drink ? Nothing expensive or tiring. What do you say ? (y/n) ";
beverageQ = responder();
}
if (beverageQ == 'Y')
{
cout << " Cool lets do it. What kind of beverage do you want to get ? (1-Coffee, 2-Beer, 3-Tea) ";
cin >> num;
FriendScore += updateFriendScore(num);
cout << "Cool, I'll come by and pick you up. See ya in a bit ! ";
cout << " O Wait !! Before I go, I wanted to tell you not to bring any money. I'll pay since we're new friends. Is that ok ?" << "(1-Yes, 2-Maybe, 3-No) ";
cin >> num;
FriendScore += updateFriendScore(num);
}
if (beverageQ != 'N')
cout << "Darn. Alright well I guess I'll talk to you later. " << endl;
cout << "You scored a " << FriendScore << " ! This score represents how good of friends you will be !" << endl;
system("pause");
return 0;
}
char responder()
{
char reply = '0';
cin >> reply;
return toupper( reply );
}
int updateFriendScore(int x)
{
int score = 0;
if (x == 1)
score = 10;
if (x == 2)
score = 5;
if (x == 3)
score = 1;
//else <- oops
//score = 0; <- oops
return score;
}
|