+ 1

Please Help!!!!

while (Age_Dara!=22 & DarasHeart>0){ if (Age_Dara>=28){ DarasHeart=1; cout << "Dara: " << Age_Dara << " YEARS OLD!?" << endl << "ARE YOU INSANE!?" << endl << "UGGH! You make me so mad!... I...I cant even look at you right now!" << endl; cout << Username << ": I'm sorry! Please forgive me!" << endl; cout << "Dara: Hmph! ...OH alright!" << endl << "But now you only get one more chance for hurting my feelings." << endl << "make a mistake like that again, and I'm done." << endl; cout << Username << ": Got it! Ok, how about "; cin >> Age_Dara; if (Age_Dara<28 & Age_Dara!=22){ cout << "Dara: Hmph. Better... but no. Sorry that was your last try. Bye." << endl; return 0; } if (Age_Dara>=28){ cout << "Dara: Ok wise guy... I'm done. GOODBYE!"; return 0; } if (Age_Dara==22){ cout << "Dara: Hmph! Lucky guess..." << endl; } } if (Age_Dara<16 & Age_Dara>0){ --DarasHeart; cout << "uhhh... really? @_@;;" << endl << "wow never would've thought that.. like... at all." << endl; cout << Username << ": Why? too high? XDD" << endl; cout << "Dara: OH HARDY HAR HAR! WE'RE SOOOOO FUNNY! T_T." << endl << "So, how old am I really?" << endl; cout << Username << ": Fine, Are you "; cin >> Age_Dara; } if (Age_Dara<0){ --DarasHeart; cout << "Dara: soo.... Now I'm an invalid? o_O?." << endl << "Heehee! XD. Well! Anyhoo..." << endl << "Ok for realsies, how old do you think I am?" << endl; cout << Username << ": For realsies I think you are "; cin >> Age_Dara; } if (Age_Dara>20

22nd Feb 2018, 11:35 PM
Jung Sa (Hanen)
Jung Sa (Hanen) - avatar
3 odpowiedzi
+ 1
if (Age_Dara>20 & Age_Dara!=22 & Age_Dara<24){ --DarasHeart; cout << "Dara: Ooo! Close... but no cigar!" << endl; cout << Username << ": Ooh DARN!" << endl; cout << "Dara: Heehee! *^_^*." << endl << " Try again?" << endl; cout << Username << ": Ok. You are "; cin >> Age_Dara; } else{ if (Age_Dara!=22 & DarasHeart>0){ --DarasHeart; cout << "Dara: Sorry. hee hee, try again?" << endl; cout << Username << ": Ok. You are "; cin >> Age_Dara; } } if (DarasHeart==0){ cout << "Dara: Woah! Look at the time, I gotta run! bye!"; return 0; } if (Age_Dara==22){ cout << "Dara: Hey! You got! good job!" << endl; } }
22nd Feb 2018, 10:34 PM
Jung Sa (Hanen)
Jung Sa (Hanen) - avatar
+ 1
It runs fine but there are 2 problems I need help with. 1. it's too long. How do I make it more efficient or shorter with the conditions set above? (I'm not that far into it yet.) 2. for the condition Age_Dara==22 shows up twice. Once when it is stated directly, and another under the condition when the Age_Dara was entered >28. How do I get it to stop and just continue with the rest of the program when the condition first realized is >28? (i.e. what happens is : "Hmph! Lucky Guess." //where I would like it to stop. "Hey you got it! Good Job!")
22nd Feb 2018, 10:39 PM
Jung Sa (Hanen)
Jung Sa (Hanen) - avatar
+ 1
uhh... can someone please respond with an answer >_>
23rd Feb 2018, 6:35 PM
Jung Sa (Hanen)
Jung Sa (Hanen) - avatar