Results 1 to 5 of 5
  1. #1
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love

    I finally finished it :)

    Well, I finally finished the daily work for today... Got some functions added, and a new header for variables. Quite excited that I got all this completed today

    [php]
    //TBQ.cpp
    #include "functions.h"
    #include "variables.h"

    using namespace std;
    int main()
    {
    do {
    system("cls");
    cout << "Hi, what is your FIRST name?" << endl;
    getline (cin,ITSASTRING); // getting the input from this line and inputting it into ITSASTRING
    stringstream(ITSASTRING) >> firstname; // transferring data from ITSASTRING to firstname
    cout << "Alright " << firstname << " what is your last?";
    getline (cin,ITSASTRING); // getting the input from this line and inputting it into ITSASTRING
    stringstream(ITSASTRING) >> lastname; // transferring data from ITSASTRING to lastname

    cout << "alrighty then " << firstname<<" " <<lastname <<", how old are you?" << endl; // displaying firstname lastname and asking how old
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> age;// the usual cin >> age
    if (age < 20) { // if age is less than 20 do the following
    cout << "Hi " << firstname<< " " <<lastname << ", welcome to my application!\ntype some random word!"<< endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> randomword;
    }
    else
    {// age was more than 20 so we do the following
    cout << "Hi " << firstname<<" " <<lastname <<" sorry, but you are too old." << endl;
    exit(0);
    }

    cout << "thats the first word that came to your mind? weird...\n"<< endl;
    cout << "Enter a number"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> thisIsANumber;

    cout << "was this your favourite number?"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> yesOrNo;

    if(yesOrNo == "y")
    {
    cout << "oh, well that was an interesting favourite number.\n"<<endl;
    }
    else if(yesOrNo == "n")
    {
    cout << "oh... what is your favourite number?\n"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> favouritenumber;
    }
    else
    {
    cout << "that wasn't an answer, genius"<<endl;
    }
    cout << "Do you like waffles?!?!?!!? (y/n)\n"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> likeShitTacos;
    if(likeShitTacos == "y")
    {
    cout << "I knoww they are awesome!!!! Belgian or Eggos?\n"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> BelgianOrEggos;
    if(BelgianOrEggos == "b")
    {
    cout << "yeaaah those are the best... with strawberrys and whipped cream right?(y/n)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> strawberry;
    if(strawberry == "y")
    {
    cout << "mmmm waffles with strawberries and whipped cream... mmmmmmmm"<<endl;
    }

    else if(strawberry == "n")
    {
    cout << "ewwwww... You still use syrup though right? (y/n)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> syrup;
    if(syrup == "y")
    {
    cout << "good... I was worried"<<endl;
    }
    else if(syrup == "n")
    {
    cout << "WTF MAN!!! PLAIN WAFFLES?!?!?! YOUR CRAZY"<<endl;
    }
    else
    {
    cout << "one more answer and thats it... Your booted off of this I swear."<<endl;
    }
    }
    else
    {
    cout << "STOP ANSWERING THAT!!!!!!!!!!!!!"<<endl;
    }

    }
    else if(BelgianOrEggos == "e")
    {
    cout << "reaally? Eggos more then Belgians? You've clearly never had a belgian waffle before..."<<endl;
    }
    else
    {
    Felse();
    }
    }
    else if(likeShitTacos == "n")
    {
    cout << "Whatt?!?! you don't like waffles? gtfo...\n"<<endl;
    }
    else
    {
    cout << "This wasn't a choice, gtfo\n"<<endl;
    }
    cout << "do you like girls or boys? (g/b)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> girlsorboys;

    if (girlsorboys == "g")
    {
    cout << "Oh, great, I do as well. You are a boy or a girl? (b/g)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> boyorgirl;
    if (boyorgirl == "g"){
    cout << "oh..."<<endl;
    }
    else if (boyorgirl == "b"){
    cout << "oooohhh good "<<endl;
    }
    else{
    cout << "don't push the wrong buttons please!! you're going to drive me insane!!!!"<<endl;
    }
    }
    else if (girlsorboys == "b")
    {
    cout << "ewwwww are you a boy or a girl... (b/g)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> boyorgirl;
    if (boyorgirl == "b"){
    cout << "ok then......\n";
    }
    else if (boyorgirl == "g"){
    cout << "ok, good "<<endl;
    }
    else{
    cout << "really... stop with the insane clicking of these random buttons"<<endl;

    }
    }

    cout << "Do you think tyler is hooooot??? (y/n)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> tylerishot;

    if (tylerishot == "y"){
    cout << "alrighty then... your a girl right? (y/n)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> girlright;

    if (girlright == "y"){
    cout << "we should like, totally go out sometime!! "<<endl;
    }
    else if (girlright == "n"){
    cout << "umm... ok then... awkwardddd"<<endl;
    }
    else{
    cout << "don't. push. the. wrong. button. again.!!!!!"<<endl;
    }
    }

    else if (tylerishot == "n"){
    cout <<"WHATT?!?! IM ABSOLUTELY 100% HOOTTT. get a life kid"<< endl;
    }
    else{
    cout <<"STOP HITTING THAT BUTTON, JESUS CHRIST."<<endl;
    }
    cout << "Do you like justin bieber? (y/n)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> justinbieber;
    if (justinbieber == "y"){
    exit(0);
    }
    else if (justinbieber == "n"){
    cout << "FINALY, SOMEBODY WHO'S HUMAN!"<<endl;
    }
    else{
    cout << "WTF?! DO YOU LIKE HIM OR NOT... (y/n)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> justinbieber;
    if (justinbieber == "y"){
    cout <<"get a life..."<<endl;
    system ("pause");
    exit(0);
    }
    else if (justinbieber == "n"){
    cout << "THANK GOD!!!!"<<endl;
    }
    else{
    cout << "really? again? your getting booted."<<endl;
    system ("pause");
    exit(0);
    }

    }
    cout << "do you like pancakes??? (y/n)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> pancakes;
    if (pancakes == "y"){
    cout <<"awesome you rock!"<<endl;
    }
    else if (pancakes == "n"){
    cout << "you don't like pancakes??? where are you from? the moon?"<<endl;
    }
    else {
    cout << "Can you please not hit the wrong button next time? It's quite annoying you know..."<<endl;
    }
    cout << "Do you like winter? (y/n)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> likewinter;
    if (likewinter == "y"){
    cout << "OEMGEE I ABSOLUTELY LOVE WINTER, WE HAVE SO MUCH IN COMMON )"<<endl;
    }
    else if (likewinter == "n") {
    cout << "ewww... what do you like?\n(s) Summer\n(S) Spring\n(f) Fall" <<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> favseason;
    if (favseason == "s"){
    cout << "really, summer is your favourite... interesting. I hate that season "<<endl;
    }
    else if (favseason == "S") {
    cout << "yeah, springs a pretty good season as well I guess..."<<endl;
    }
    else if (favseason == "f") {
    cout << "Fall, thats an Ok season I guess... Playing in the leaves is pretty fun I guess."<<endl;
    }
    else{
    cout << "Ok... DON'T PUSH THE WRONG BUTTON. I'm seriously going to exit(0); you...."<<endl;
    }
    }
    else {
    cout <<"STOP THAT"<<endl;
    }
    cout <<"Have you ever kissed Cody Miller? (y/n)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> kissedcody;
    if (kissedcody == "y"){
    cout <<"Please tell me your a girl...(y/n)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> Cgirl;
    if (Cgirl == "y"){
    cout <<"oh... how interesting, I didn't know he's kissed YOU."<<endl;
    }
    else if (Cgirl == "n"){
    cout << "oh... I'll be talking to him later"<<endl;
    }
    else {
    cout << "are you going to stop hitting the wrong button any time soon?"<<endl;
    }
    }
    else if (kissedcody == "n"){
    cout <<"Well, I could've figured THAT out..."<<endl;
    }
    else{
    cout<<"FOR **** SAKES STOP THAT..."<<endl;
    }
    if(Frestart (ITSASTRING, restart) == "y"){
    restart = "y";
    }
    else
    {
    restart = "n";
    }

    }

    while(restart == "y");
    return 0;
    }
    [/php]

    [php]
    //variables.h
    #include <string>
    using namespace std;

    int thisIsANumber; // used for random number
    string yesOrNo; // used for favourite number
    string likeShitTacos; // used for waffles
    string BelgianOrEggos; // used for belgian or eggos
    string strawberry; // used for strawberries and whipped cream on belgian waffles
    string syrup; // used for syrup on belgian waffles
    string ITSASTRING; // empty string, used for transfering variables
    string firstname; // second string, used for first name
    string lastname; // third string, used for last name
    int age; // int, used for age
    string randomword; // used for random word
    int favouritenumber; // used for favourite number
    string girlsorboys; // likes girls or boys
    string boyorgirl; // is a boy or girl
    string tylerishot; // am I hot? obviously...
    string restart; // restart the game?
    string girlright; // your a girl right?
    string justinbieber; // you better not like justin bieber
    string pancakes; // like pancakes?
    string likewinter; // like winter?
    string kissedcody; // ever kissed cody miller?
    string Cgirl; // girl kissed cody right?
    string favseason; // fav season
    string computer; // like the computer
    string boyORgirlfriend; // have a boyorgirlfriend
    string girlORboyfriend; // boy or girlfriend?
    string boyfriendname; // boyfriend's name
    string girlfriendname; // girlfriend's name
    string picklesandpopcorn; // like pickles and popcorn?
    string eathair; // eat your hair?
    string smoothies; // like smoothies?
    string hotdogs; // like hotdogs?
    string princesses; // like princesses?
    [/php]
    [php]
    //functions.h
    #include <iostream>
    #include <string>
    #include <sstream>

    using namespace std;

    void Felse(){
    cout << "that wasn't an answer...\n";
    }

    void test (string a, char c[40], char e[40]){
    if(a == "y"){
    cout << c << endl;
    }
    else if(a == "n"){
    cout << e << endl;
    }
    else { Felse(); }
    }

    string Frestart (string ITSASTRING , string FFrestart){
    cout <<"time to end this game... if you want "<<endl;

    cout << "would you like to play again? (y/n)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> FFrestart;

    if (FFrestart == "y"){ // if they want to restart, play again
    cout << "alright, here we go!!!!"<<endl;
    }
    else if (FFrestart == "n"){ // if they don't ensure they don't
    cout << "I'm going to ask again, just for safety's sake. Would you like to play again? (y/n)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> FFrestart;

    if (FFrestart == "y"){
    cout << "alright, I'm going to restart it for you"<<endl;
    }
    else if (FFrestart == "n"){
    exit(0);
    }
    else {
    cout << "sorry, what was that?\ndid you want to replay or not? (y/n)"<<endl;
    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> FFrestart;

    if (FFrestart == "y"){
    cout << "alright, going to restart it for you"<<endl;
    }
    else{
    exit(0);
    }

    }
    }
    return (FFrestart);
    }
    /*todo: add Fyes and Fno functions, use them in the test function. Re-name the test function to Fif.

    Add Fyes, Fno and Felse header files to contain all the variables used for Fyes, Fno and Felse (variables used when calling the function in TBQ.cpp) */
    [/php]



    This is an extremely simple text based questionaire... Going to be adding a LOT more code. My todo list is located in the functions.h. The todo list is what I'll be doing on the next day. I make a new todo list every day.

    *note, this is NOT glitchy code. It works perfectly fine. I do NOT need criticism, I will ignore it. This is my text based questionaire that I'll be making on my own. With a bit of help from others with the errors*


    Just excited that after hundreds of errors (literally...) I figured em all out without any help and finished the hardest day of coding I've ever had. Use this code if you want, but please note it is NOT currently wrote for accesibility OR efficiency... very messy code, header files which aren't needed... but it's all getting cleaned up slowly
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

  2. #2
    scimmyboy's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Location
    https://mpgh.net MPGHCash: $442,596,199
    Posts
    5,645
    Reputation
    26
    Thanks
    896
    My Mood
    Happy
    wow, thats alot of stuff in your header file....

    anyways, heres some constructive criticism.

    instead of using string for all your variables, why not just use char? since your answers are either Y or N, you dont need to use string.

    and, why are you doing so much stuff in main? alot of that stuff can be done in multiple functions, making your code look much neater and easy to proofread after you have written it. plus, it gives u some practice in calling functions and creating prototypes

    ignore this if u want...

  3. #3
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    Quote Originally Posted by scimmyboy View Post
    wow, thats alot of stuff in your header file....

    anyways, heres some constructive criticism.

    instead of using string for all your variables, why not just use char? since your answers are either Y or N, you dont need to use string.

    and, why are you doing so much stuff in main? alot of that stuff can be done in multiple functions, making your code look much neater and easy to proofread after you have written it. plus, it gives u some practice in calling functions and creating prototypes

    ignore this if u want...
    in my todo list, I'm making Fyes, Fno and Fif functions, which will eventually control all of my if statements to clean it up. I also am going to be getting rid of ITSASTRING and sstream and just using getline (cin, stringnamehere).

    I'm going to be changing the answers into yes or no, rather then y/n.

    I do a lot of stuff in main because back when I created this, I didn't understand functions, or anything else. Just a few days ago I started learning functions, so I'm slowly cleaning up the code.

    Thanks for the criticism, you know how to give it politely (I usually don't want criticism, because it's normally negative)
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

  4. #4
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    This demands celebration.

    It's good to declare some of your variables locally, the time has to be appropriate though. I see you declared a variable "ITSASTRING" to transfer.. That could be declared locally whenever you need to transfer. Name your variables accordingly... when you start doing bigger projects it will be beneficial.

  5. #5
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    Quote Originally Posted by Void View Post
    This demands celebration.

    It's good to declare some of your variables locally, the time has to be appropriate though. I see you declared a variable "ITSASTRING" to transfer.. That could be declared locally whenever you need to transfer. Name your variables accordingly... when you start doing bigger projects it will be beneficial.
    no ITSASTRING has been used for transfer because I was memorizing the

    getline (cin,ITSASTRING);
    stringstream(ITSASTRING) >> var2;

    part.
    I only used ITSASTRING as the name because I didn't know what to use it for at first It was back while I was learning about strings.

    And yes, when I start doing bigger projects with other people I will find out how they go through the naming process, what their form of "organized" is. Because to me, I don't even need to name them at all... I could use 1-20000000 as my variables and remember what they are.

    But thats all because of my mental "disability" autism
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

Similar Threads

  1. [Release] Finally finished it.
    By Son in forum Call of Duty Modern Warfare 2 Discussions
    Replies: 16
    Last Post: 06-14-2011, 07:22 PM
  2. Finally finished.
    By Robert in forum General
    Replies: 22
    Last Post: 06-06-2011, 08:30 AM
  3. jump key finally finished
    By supercarz1991 in forum Combat Arms Mod Discussion
    Replies: 20
    Last Post: 03-29-2011, 05:05 PM
  4. Finally Finished
    By Robert in forum General
    Replies: 9
    Last Post: 11-30-2010, 04:56 AM
  5. Finally finished took me 3 months
    By artistic in forum Art & Graphic Design
    Replies: 3
    Last Post: 03-13-2010, 01:51 PM