Advertisement
lhaziri

Friendshipkorrigiert_mit_goto

Nov 16th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.53 KB | None | 0 0
  1. \*
  2.  * Friend.cpp
  3.  *
  4.  *  Created on: 16.11.2019
  5.  *      Author: lhazi
  6.  */
  7.  
  8. #include "Friend.h"
  9. #include<iostream>
  10. #include<string>
  11.  
  12. using namespace std;
  13.  
  14. int main(){
  15.     //Variables
  16.         string n = "n";
  17.         string res = "res";
  18.         string hot = "hot";
  19.         string interest = "interest";
  20.         int drinks,i;
  21.  
  22. Home:   cout << "Place phone call." <<endl;                                   //place phone call
  23.         cout << "Home?(yes or no)" <<endl;
  24.         cin>> n;
  25.  
  26.         if(n== "yes" || n== "no"){
  27.             if(n=="yes"){
  28.                 cout << "Would you like to share a meal?" <<endl;
  29.             }
  30.             if(n== "no"){                                                         // Falls nein, dann
  31.                 cout << "Leave message." <<endl;
  32.                 cout << "Wait for callback." <<endl;
  33.                 cout << "Would you like to share a meal?" <<endl;
  34.             }
  35.         }else{
  36.             goto Home;
  37.         }
  38.  
  39. Resp:   cout << "What is the response(yes or no):?" <<endl;
  40.         cin>> res;
  41.         if(res== "yes" || res== "no"){
  42.             if(res== "yes") {
  43.                 cout << "Dine together."<<endl;
  44.             }
  45.             if(res== "no"){
  46. Bev:            cout << "Do you enjoy a hot beverage?"<<endl;
  47.                 cout << "What is the response?(yes or no)"<<endl;
  48.                 cin >> hot;
  49.             }
  50.         }else{
  51.             goto Resp;
  52.         }
  53.  
  54.         if(hot== "yes" || hot== "no"){
  55.             if (hot== "yes"){
  56. Hot:            cout<< "1.Tea?, 2.Coffee?, 3.Cocoa?"<<endl;
  57.                 cin>> drinks;
  58.  
  59.                 if(drinks == 1){
  60.                 cout << "Have tea."<<endl;
  61.                 }
  62.                 else if(drinks == 2){
  63.                     cout << "Have coffee."<<endl;
  64.                 }
  65.                 else if(drinks == 3){
  66.                     cout << "Have cocoa."<<endl;
  67.                 }
  68.                 else{
  69.                     goto Hot;
  70.                 }
  71.             }
  72.             if(hot== "no"){
  73.                 cout << "Recreational activity?"<<endl;
  74.                 for(i=0; i<=7; i++){
  75. Inte:               cout << "Tell me one of your interests."<<endl;
  76.                     cout << "Do I share that interest(yes or no)?"<<endl;
  77.                     cin >> interest;
  78.                     if(interest== "yes" || interest== "no"){
  79.                         if (i==7 && interest== "no"){
  80.                             cout << "Choose least objectional interest."<<endl;
  81.                             cout << "Partake in interest."<<endl;
  82.                         }
  83.                         else if(interest== "yes"){
  84.                             i = 8;
  85.                             cout << "Why don't we do that togehter?"<<endl;
  86.                             cout << "Partake in interest." <<endl;
  87.                         }
  88.                     } else{
  89.                         goto Inte;
  90.                     }
  91.                 }
  92.             }
  93.         } else{
  94.             goto Bev;
  95.         }
  96.  
  97.         cout<< "Begin friendship!"<<endl;
  98.  
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement