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 9 of 9

Thread: Completely new to Java, don't understand my first Assignment

  1. #1
    Junior Member
    Join Date
    Sep 2014
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Completely new to Java, don't understand my first Assignment

    So I am college student and I am completely new to Java, and I am having a really rough start. Unfortunately, this is more of an intermediate class, and I cannot take a fundalmentals course because it doesn't fit into my Education plan. I've read the chapters and I have my first Assignment, but I don't even understand how this works. Can some explain to me what I am suppose to do? I have talked to my professor a million times and he keeps telling me to drop out and take an easier course, but I do not have that option.

    This is the assignment:

    Edit the code in both the Car.java file and Main.java file wherever you see a TODO such that all the tests pass (Expected value = Actual value) when you run the application.


    public void decelerate(Integer amountToDecreaseBy) {
    // TODO YOUR CODE GOES HERE


    Car myBMW = new Car();
    // TODO YOUR CODE GOES HERE

    I don't really know what I am exactly suppose to edit here... and I am suppose to make it work somehow. I just feel like this wasn't explained all that well or that I am just so bad at Java, that I do not understand the assignment. Help please!


  2. #2
    Senior Member
    Join Date
    Jul 2013
    Location
    Europe
    Posts
    666
    Thanks
    0
    Thanked 121 Times in 105 Posts

    Default Re: Completely new to Java, don't understand my first Assignment

    We cant do anything with that either. Its far too little information to actually help you.

    By the way, you wont find anybody here who will write the code for you. If you try it, we can try to help you by giving you hints and tips, but thats about it.
    If you want to actually learn how to program, try online tutorials or a book, or perhaps both.

  3. #3
    Junior Member
    Join Date
    Sep 2014
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Completely new to Java, don't understand my first Assignment

    I don't want anyone to write anything for me, I just don't understand what exaxtly I am suppose to do

  4. #4
    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: Completely new to Java, don't understand my first Assignment

    Quote Originally Posted by Jhop86 View Post
    I cannot take a fundalmentals course because it doesn't fit into my Education plan. I have talked to my professor a million times and he keeps telling me to drop out and take an easier course, but I do not have that option.
    Sounds like it's time to change your "education plan". If the professor is telling you that you don't have the prerequisites for the class, then staying in the class simply isn't going to work.
    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!

  5. #5
    Senior Member
    Join Date
    Jul 2013
    Location
    Europe
    Posts
    666
    Thanks
    0
    Thanked 121 Times in 105 Posts

    Default Re: Completely new to Java, don't understand my first Assignment

    Quote Originally Posted by Jhop86 View Post
    I don't want anyone to write anything for me, I just don't understand what exaxtly I am suppose to do
    As I said, we dont know either.
    After all, you didnt post the tests that need to pass. The TODO by itself is quite pointless unless you have a look at the tests.

  6. #6
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Re: Completely new to Java, don't understand my first Assignment

    Quote Originally Posted by Jhop86 View Post
    I don't want anyone to write anything for me
    Don't worry, most people on this forum won't write it for you, just help you explain it. We actually frown upon people giving answers to homework assignments.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  7. #7
    Member
    Join Date
    May 2014
    Posts
    36
    Thanks
    6
    Thanked 3 Times in 3 Posts

    Default Re: Completely new to Java, don't understand my first Assignment

    Harsh, to be honest when I read his posts it seems as though the professor just gave to little info.
    That does not mean that he doesn't have what it takes to learn to program like Kevin suggests :0
    English is not my native language (Typo alert).

  8. #8
    Junior Member
    Join Date
    Oct 2013
    Posts
    8
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Completely new to Java, don't understand my first Assignment

    Lucky you had a java course to begin with. :\

    Your main file main method is where the file starts. I don't know how you are supposed to display the output, if it's to the console or whether you are supposed to make a loop yourself or if the main method has it ready to go but....

    in your main method, you would put...

    int increment = (actualvalue-expectedvalue)/4;
     
    while(myBMW.speed > expectedvalue){
    myBMW.decelerate(increment);
    //or you can just put in the different between the car's speed, and what you want the value to equal
    //instead of my "increment" variable which would require this to loop 4 times. :)
    }
     
    System.out.println(myBMW.speed);

    You should know where to fill in any errors, or adjust according to your project. If you don't, look online for thenewboston java tutorials on youtube. If you are still lost, then I can't help you any further via forum.

  9. #9
    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: Completely new to Java, don't understand my first Assignment

    Quote Originally Posted by Time4Java View Post
    That does not mean that he doesn't have what it takes to learn to program like Kevin suggests :0
    Please don't put words into my mouth. I did not suggest that he "doesn't have what it takes to learn to program", and in fact I would not say that, about anybody.

    What I did say is that he might not have the prerequisites for the class, which the professor seems to agree with. That doesn't mean he *can't* learn how to program, it just means that he *took a difficult class to soon*, before he had the knowledge required to understand what the class was teaching.

    He can absolutely learn how to program. He just has to take the basic classes before the advanced classes. He doesn't seem to want to do that because it doesn't fit into his "education plan", and that's a recipe for failure.
    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!

Similar Threads

  1. help please i don't understand why the count is not adding .
    By gagakzs in forum What's Wrong With My Code?
    Replies: 3
    Last Post: July 5th, 2014, 05:57 AM
  2. I don't understand this. Please help...
    By javaman1 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: June 20th, 2014, 04:32 AM
  3. [SOLVED] Completely clueless as to how to do this assignment.
    By Disruption in forum What's Wrong With My Code?
    Replies: 15
    Last Post: November 11th, 2013, 10:39 AM
  4. Replies: 1
    Last Post: December 13th, 2012, 08:47 PM
  5. I don't understand what I'm supposed to do
    By dmcettrick in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 11th, 2011, 09:34 AM