Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Trouble with my IF's

Trouble with my IF's

Scheduled Pinned Locked Moved C#
helpquestion
8 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Patrick_N3WB1E
    wrote on last edited by
    #1

    Im trying to write a program below. INPUT "Whats your name?"; NAME$ PRINT "Hello "NAME$" how are you doing today?"; INPUT "Good or Bad?"; EMOSTATE$ IF EMOSTATE$ = "Good" Then PRINT "Thats good, tell me about it!"; INPUT "Why is it a good day!?"; WHYG$ PRINT "Thats really cool!"; END IF IF EMOSTATE "Bad" Then PRINT "Aww, im sorry. Why was it so bad?"; INPUT "What was bad about your day."; WHYB$ It always error's out at the INPUT "Good or Bad?"; EMOSTATE$ Can any one help me? ><

    L C D 3 Replies Last reply
    0
    • P Patrick_N3WB1E

      Im trying to write a program below. INPUT "Whats your name?"; NAME$ PRINT "Hello "NAME$" how are you doing today?"; INPUT "Good or Bad?"; EMOSTATE$ IF EMOSTATE$ = "Good" Then PRINT "Thats good, tell me about it!"; INPUT "Why is it a good day!?"; WHYG$ PRINT "Thats really cool!"; END IF IF EMOSTATE "Bad" Then PRINT "Aww, im sorry. Why was it so bad?"; INPUT "What was bad about your day."; WHYB$ It always error's out at the INPUT "Good or Bad?"; EMOSTATE$ Can any one help me? ><

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, that is a great little program, but I doubt the C# compiler will accept any single line of it. What are you doing in this forum? BTW Most programming languages I am aware of know the concept of operators, such as + - = < > and many more. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      Fixturized forever. :confused:


      1 Reply Last reply
      0
      • P Patrick_N3WB1E

        Im trying to write a program below. INPUT "Whats your name?"; NAME$ PRINT "Hello "NAME$" how are you doing today?"; INPUT "Good or Bad?"; EMOSTATE$ IF EMOSTATE$ = "Good" Then PRINT "Thats good, tell me about it!"; INPUT "Why is it a good day!?"; WHYG$ PRINT "Thats really cool!"; END IF IF EMOSTATE "Bad" Then PRINT "Aww, im sorry. Why was it so bad?"; INPUT "What was bad about your day."; WHYB$ It always error's out at the INPUT "Good or Bad?"; EMOSTATE$ Can any one help me? ><

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Wow. It's a good thing you found this forum. Abandon this ugly excuse for a language and learn C# instead, you'll be glad you did. What is this ?

        Christian Graus Driven to the arms of OSX by Vista.

        P 1 Reply Last reply
        0
        • C Christian Graus

          Wow. It's a good thing you found this forum. Abandon this ugly excuse for a language and learn C# instead, you'll be glad you did. What is this ?

          Christian Graus Driven to the arms of OSX by Vista.

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Maybe he needz codez for a compiler?

          D 1 Reply Last reply
          0
          • P PIEBALDconsult

            Maybe he needz codez for a compiler?

            D Offline
            D Offline
            danzar
            wrote on last edited by
            #5

            Is that COBOL? or RPG? been a while but looks like it kinda

            D 1 Reply Last reply
            0
            • D danzar

              Is that COBOL? or RPG? been a while but looks like it kinda

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              That's really old BASIC.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008

              P 1 Reply Last reply
              0
              • P Patrick_N3WB1E

                Im trying to write a program below. INPUT "Whats your name?"; NAME$ PRINT "Hello "NAME$" how are you doing today?"; INPUT "Good or Bad?"; EMOSTATE$ IF EMOSTATE$ = "Good" Then PRINT "Thats good, tell me about it!"; INPUT "Why is it a good day!?"; WHYG$ PRINT "Thats really cool!"; END IF IF EMOSTATE "Bad" Then PRINT "Aww, im sorry. Why was it so bad?"; INPUT "What was bad about your day."; WHYB$ It always error's out at the INPUT "Good or Bad?"; EMOSTATE$ Can any one help me? ><

                D Offline
                D Offline
                DaveyM69
                wrote on last edited by
                #7

                Wow! I haven't seen good old BASIC like that for years! It's like an old friend enemy revisiting. This is the C# forum in case you didn't realise. A rough mock up of your code in C# in case you want to give one of these new-fangled languages a try!

                string name;
                ConsoleKeyInfo emoState = new ConsoleKeyInfo();
                string why;
                Console.Write("What is your name? ");
                name = Console.ReadLine();
                Console.WriteLine(string.Format("Hello {0}, how are you doing today? ", name));
                while (emoState.Key != ConsoleKey.G && emoState.Key != ConsoleKey.B)
                {
                Console.Write("Good (g) or bad (b)? ");
                emoState = Console.ReadKey(false);
                Console.WriteLine();
                }
                switch (emoState.Key)
                {
                case ConsoleKey.G:
                Console.WriteLine("Thats good, tell me about it!");
                Console.Write("Why is it a good day? ");
                why = Console.ReadLine();
                break;
                default:
                Console.WriteLine("Aww, im sorry.");
                Console.Write("What was bad about your day? ");
                why = Console.ReadLine();
                break;
                }
                Console.Write("Press any key to exit...");
                Console.Read();

                Dave
                BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
                Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

                1 Reply Last reply
                0
                • D Dave Kreskowiak

                  That's really old BASIC.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  P Offline
                  P Offline
                  PIEBALDconsult
                  wrote on last edited by
                  #8

                  Right. Do I dare reach over to my bookshelf to get my BASIC-Plus and Turbo BASIC books?

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups