Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 11 of 11

Thread: First assignment java program

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default First assignment java program

    I am taking a java programming class to achieve my bachelors degree in IT. Not good at the software and for sure not the programming. I was given this code:
    resultOut = (integerOne + integerTwo) * integerThree – integerFour
    and told to identify the errors and use the five step approach.

    What am I going to need to complete this code and make it functional?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: First assignment java program

    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Apr 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: First assignment java program

    I recognize a couple of obvious issues...the semicolon at the end and I'm sure it needs some input statements for the interger statements. Also, body brackets and class header and method header. Any help in writing what's missing is greatly appreciated

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: First assignment java program

    Put it in a source file and compile it to get the compiler's list of errors. Fix them and compile it again.
    Continue until there are no error messages.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Apr 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: First assignment java program

    How would I begin the source file? public class Integer?

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: First assignment java program

    Choose a class name that is NOT one of the java SE classes.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Member
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    54
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Default Re: First assignment java program

    Quote Originally Posted by frfields276 View Post
    I recognize a couple of obvious issues...the semicolon at the end and I'm sure it needs some input statements for the interger statements. Also, body brackets and class header and method header. Any help in writing what's missing is greatly appreciated
    Open a fully functional java program and use it as a checklist to see what the code needs to be functional. So far, you've identified there has to be a ; at the end, a class and a method (either a main method or any other method). I'm not sure exactly what you mean by body brackets. Make sure the name is not Integer, as that can cause you a lot of grief since Integer is a wrapper class for int. Make the name something informative. You may also want to declare a package statement, which tells the compiler where the .java and .class files will be stored on your computer.

    I never learned a clear-cut five step approach, so can you explain what that is?

  8. #8
    Member llowe29's Avatar
    Join Date
    Jul 2013
    Posts
    116
    My Mood
    Tired
    Thanks
    9
    Thanked 5 Times in 5 Posts

    Default Re: First assignment java program

    We dont do your assignment.

  9. #9
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,545
    My Mood
    Grumpy
    Thanks
    0
    Thanked 167 Times in 158 Posts

    Default Re: First assignment java program

    Stop replying to old posts!
    Improving the world one idiot at a time!

  10. #10
    Member llowe29's Avatar
    Join Date
    Jul 2013
    Posts
    116
    My Mood
    Tired
    Thanks
    9
    Thanked 5 Times in 5 Posts

    Default Re: First assignment java program

    Just by replying to my post you just did.

  11. #11
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: First assignment java program

    Quote Originally Posted by llowe29 View Post
    Just by replying to my post you just did.
    Only to ask you to stop, which is the correct thing to do. We have dozens or hundreds of posts here a day, and they're hard enough to keep track of without you bumping old posts to the top. I'm closing this thread. You've been asked to stop replying to old posts, and refusal to take that advice will result in moderator action. This is a technical forum, we don't have time for playground "but you did it too!" nonsense.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  12. The Following User Says Thank You to KevinWorkman For This Useful Post:

    jps (August 3rd, 2013)

Similar Threads

  1. Replies: 8
    Last Post: February 12th, 2013, 05:45 AM
  2. Beginner,first java program assignment
    By geezlouise in forum What's Wrong With My Code?
    Replies: 7
    Last Post: January 31st, 2013, 08:36 PM
  3. Creating a Sudoku Program Assignment
    By xion0374 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 17th, 2012, 07:48 PM
  4. assignment troubles polymorphism (guide for assignment included)
    By tdawg422 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 8th, 2011, 10:01 AM
  5. Replies: 1
    Last Post: February 22nd, 2010, 08:20 AM