If you know computers check this out..

Collapse

Recommended Videos

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dtownballa
    MVP
    • Feb 2003
    • 1450

    #16
    Re: If you know computers check this out..

    Originally posted by dagger55
    Not sure what development enviornment you are using, but there are some that have plugins that create the GUI for you...
    Can you direct me to the plug ins? And the only thing im worried about if the teacher finds something in my code that he didn't teach us it might make him go "hmmmmm"

    Originally posted by dagger55
    sounds like you need to visit the Java API.


    Also, ever been to krugle.com?
    Never been to the site, but toinght when i start back up, I will visit it.
    PSN: The_TechNinja
    Check me out on YouTube as well: http://tinyurl.com/lqd6s9j

    Comment

    • aukevin
      War Eagle, Go Braves!
      • Dec 2002
      • 14700

      #17
      Re: If you know computers check this out..

      Originally posted by Dtownballa
      What your saying is making sense, but acually implementing this for me however, might be a bit difficult.

      Can you send me the file with the changes you've made for the syntax errors.

      Tonight when i start working on the code somemore, I'm going to try to do what you said, as far as the loop.

      Thanks for all the help guys BTW!
      I don't think I should send you my corrections, because when I was first learning this stuff in school I didn't take the time to learn everything right away and it made my first couple quarters pretty tough until I really understood it all. Just experience talking... I will continue to look at your code and try to help you out though!

      Just take a look at the switch statement on this page: http://www.leepoint.net/notes-java/f...h-general.html

      Notice you're only suppose to say switch once, you were saying it for every case of the switch statement.

      That was your only syntax error, so that was good

      Displaying your results value on the JOptionPane is just like any other message you have been putting on them. Just print it out like you would in a print statement, for example:
      "You answer is: "+results
      would be what your JOptionPane should display.

      Just try getting rid of those do while loops around all your JOptionPane's and then try to follow this basic outline for your main method when you start coding again:


      public static void main(String[] args)

      Declare your variables (num1, num2, choice, results, stop)

      while(stop condition){

      JOptionPane to ask for the first number

      JOptionPane to ask for the second number

      JOptionPane to ask for the math expression to use

      Your switch statements to compute your results

      JOptionPane to display your results.

      JOptionPane to ask the user to continue or quit.

      } //end while loop

      System.exit(0);

      } //end main method
      Last edited by aukevin; 10-12-2007, 10:13 AM.

      Atlanta Braves
      - Auburn Tigers - Nashville Predators

      Comment

      • aukevin
        War Eagle, Go Braves!
        • Dec 2002
        • 14700

        #18
        Re: If you know computers check this out..

        By the way, if your school isn't providing you with some kind of development tool, it is really helpful to use one. I use Eclipse. It will help you with your formatting and give you information as you are coding when you have syntax errors and it will give you great hints on how to fix it.

        Atlanta Braves
        - Auburn Tigers - Nashville Predators

        Comment

        • p_rushing
          Hall Of Fame
          • Feb 2004
          • 14514

          #19
          Re: If you know computers check this out..

          basic idea is good, if you do what aukevin says, it will work better

          search google for sun java api, its a list of all the java classes that are available

          Comment

          • The GIGGAS
            Timbers - Jags - Hokies
            • Mar 2003
            • 28474

            #20
            Re: If you know computers check this out..

            Eclipse is great.

            The APIs are a godsend. Use them whenever you can.
            Rose City 'Til I Die
            Duuuuuuuvvvvaaaaaaaal
            Hokie Hokie Hokie Hy

            Member: OS Uni Snob Assoc.
            OS OT Post Champ '11

            Twitter: @TheGIGGAS_OS
            Xbox Live: TheGIGGAS
            3DS: 1349-7755-3870

            Comment

            • Bacardi151
              **t *f y**r *l*m*nt D*nny
              • Aug 2002
              • 3114

              #21
              Re: If you know computers check this out..

              Originally posted by The GIGGAS
              Eclipse is great.

              The APIs are a godsend. Use them whenever you can.

              I approve of this message
              Eternal Salvation or triple your money back!

              Comment

              • Dtownballa
                MVP
                • Feb 2003
                • 1450

                #22
                Re: If you know computers check this out..

                Originally posted by aukevin
                By the way, if your school isn't providing you with some kind of development tool, it is really helpful to use one. I use Eclipse. It will help you with your formatting and give you information as you are coding when you have syntax errors and it will give you great hints on how to fix it.
                Just Jgrasp, and i think its terrible software.
                Last edited by Dtownballa; 10-15-2007, 09:09 AM.
                PSN: The_TechNinja
                Check me out on YouTube as well: http://tinyurl.com/lqd6s9j

                Comment

                • UNC_Pete
                  MVP
                  • Jun 2005
                  • 2487

                  #23
                  Re: If you know computers check this out..

                  Originally posted by Bacardi151
                  I approve of this message
                  Eclipse is very nice. Going back for Software Engineering grad cert focused on Java and it is a very nice development program.

                  Comment

                  • aukevin
                    War Eagle, Go Braves!
                    • Dec 2002
                    • 14700

                    #24
                    Re: If you know computers check this out..

                    Originally posted by Dtownballa
                    Just Jgrasp, and i think its terrible software.
                    I used Jgrasp when I was in college. I didn't mind it too much because the only other alternative at my school were generic text editors, but that was before I used anything like Eclipse.

                    Atlanta Braves
                    - Auburn Tigers - Nashville Predators

                    Comment

                    • The GIGGAS
                      Timbers - Jags - Hokies
                      • Mar 2003
                      • 28474

                      #25
                      Re: If you know computers check this out..

                      For whatever reason, though.. I've been using vim to work on my programs and just running them on the command shell using SSH into the CS server at my school.

                      But eclipse is great when you can't vi.
                      Rose City 'Til I Die
                      Duuuuuuuvvvvaaaaaaaal
                      Hokie Hokie Hokie Hy

                      Member: OS Uni Snob Assoc.
                      OS OT Post Champ '11

                      Twitter: @TheGIGGAS_OS
                      Xbox Live: TheGIGGAS
                      3DS: 1349-7755-3870

                      Comment

                      • mgoblue
                        Go Wings!
                        • Jul 2002
                        • 25477

                        #26
                        Re: If you know computers check this out..

                        Originally posted by aukevin
                        By the way, if your school isn't providing you with some kind of development tool, it is really helpful to use one. I use Eclipse. It will help you with your formatting and give you information as you are coding when you have syntax errors and it will give you great hints on how to fix it.
                        Eclipse was nice...I tried that for free, but more co-workers were using Coda and work would pay for that. I prefer Coda for its ability to link to an external machine where the files are kept, Eclipse didn't want to play as nicely that way.

                        Back in college I'd use Crimson Editor if I just needed something to check syntax
                        Nintendo Switch Friend Code: SW-7009-7102-8818

                        Comment

                        • aukevin
                          War Eagle, Go Braves!
                          • Dec 2002
                          • 14700

                          #27
                          Re: If you know computers check this out..

                          Originally posted by mgoblue
                          Eclipse was nice...I tried that for free, but more co-workers were using Coda and work would pay for that. I prefer Coda for its ability to link to an external machine where the files are kept, Eclipse didn't want to play as nicely that way.

                          Back in college I'd use Crimson Editor if I just needed something to check syntax
                          I wish I could use Eclipse at work (we all have our source code locally on each machine) but our code management software (TeamWare) isn't supported by Eclipse, so I can't use it. I'm using the ancient Forte for Java to code in, which I don't care for anymore. It used to be pretty okay. The new version of Netbeans (5.5 and 6) seem to be pretty nice and similar to Eclipse. They support TeamWare so eventually I'll get around to getting that going and working with it.

                          Atlanta Braves
                          - Auburn Tigers - Nashville Predators

                          Comment

                          • Dtownballa
                            MVP
                            • Feb 2003
                            • 1450

                            #28
                            Re: If you know computers check this out..

                            Hey guys, im having a hard time figuring out how to string varible assignments. Also assigning that function to a key im stilling having issues with. and thus far you've all been great help, but now im getting to the nitty griddy and its getting difficult.

                            in my code i have:

                            case 3:
                            {
                            results = (num * num2);
                            //string assignment variables goes here
                            }
                            break;


                            and im not sure, how do i code string assignment variables.

                            also:

                            at the end of my switch statement i have:

                            s = JOptionPane.showInputDialog("Select a math operation: \n 1: Add \n 2: Subtract \n 3: Multiply \n Divide");
                            choice = Integer.parseInt(s);

                            That should display a message and an input line for the user to make a selection, and will the numbers 1-4 correspond for with my switch statement?
                            Last edited by Dtownballa; 10-15-2007, 11:07 PM.
                            PSN: The_TechNinja
                            Check me out on YouTube as well: http://tinyurl.com/lqd6s9j

                            Comment

                            • aukevin
                              War Eagle, Go Braves!
                              • Dec 2002
                              • 14700

                              #29
                              Re: If you know computers check this out..

                              Originally posted by Dtownballa
                              Hey guys, im having a hard time figuring out how to string varible assignments. Also assigning that function to a key im stilling having issues with. and thus far you've all been great help, but now im getting to the nitty griddy and its getting difficult.

                              in my code i have:

                              case 3:
                              {
                              results = (num * num2);
                              //string assignment variables goes here
                              }
                              break;


                              and im not sure, how do i code string assignment variables.

                              also:

                              at the end of my switch statement i have:

                              s = JOptionPane.showInputDialog("Select a math operation: \n 1: Add \n 2: Subtract \n 3: Multiply \n Divide");
                              choice = Integer.parseInt(s);

                              That should display a message and an input line for the user to make a selection, and will the numbers 1-4 correspond for with my switch statement?
                              That was one of your typos in the original code. I think that should have been:
                              num1 * num2

                              Is that why you are getting a compile error there? I'm pretty sure that break needs to be inside the curly brace as well.

                              I'm don't really follow what you are talking about when you say "Also assigning that function to a key im stilling having issues with."

                              Atlanta Braves
                              - Auburn Tigers - Nashville Predators

                              Comment

                              • Dtownballa
                                MVP
                                • Feb 2003
                                • 1450

                                #30
                                Re: If you know computers check this out..

                                Originally posted by aukevin
                                That was one of your typos in the original code. I think that should have been:
                                num1 * num2

                                Is that why you are getting a compile error there? I'm pretty sure that break needs to be inside the curly brace as well.

                                I'm don't really follow what you are talking about when you say "Also assigning that function to a key im stilling having issues with."
                                heh i wrote that on the way to bed.

                                Let me rephrase:

                                I want to assign the keypress to activate the switch statement. I'm not sure which line of code that i currently have would acually make that happen, or which line i would need to enter under each case.
                                PSN: The_TechNinja
                                Check me out on YouTube as well: http://tinyurl.com/lqd6s9j

                                Comment

                                Working...