YesNoOk
avatar

Java Programming I don't get (Homework help basically) (Read 858 times)

Started by Azasuke Kaijin, February 18, 2010, 09:24:06 pm
Share this topic:
Java Programming I don't get (Homework help basically)
#1  February 18, 2010, 09:24:06 pm
  • ****
  • Don't care if it's a sword or an egg, put it down!
    • www.youtube.com/profile?user=CandoraAuthes
Ha ha I have no idea what's going on. If any of you know and are willing to help (Even answer!) it would be so amazing. Maybe even explain what's going on.

This is about classes. And mutators and a whole bunch of stuff that I don't even get.

1. Assume that a class named Auto exists. The Auto class has three messages that can be sent to it to obtain the make, mode, and year of an Auto object. The message names are getMake(), getModel(), and getYear(). None of these messages have any input parameters. The getMake and getModel messages return a string value, and the getYear message returns an integer value. Write the code statements required to declare a variable of type Auto, and send the three messages listed above to obtain the default values generated when the object was instantiated. Use the System.out method to print the values obtained to the screen.

2. Write the code for three constructors for the Auto class mentioned in a previous question. The Auto class has three instance variables named make, model, and year. The make and model are String objects, and the year is an integer value. Write a default constructor that initializes the make and model fields to a null value and the year variable to a value of 0. Write an initializing constructor that accepts parameters from the caller to set the values. Finally, write a copy constructor that accepts an Auto object as a parameter and copies its values to a new instance of the object.

If it helps any, we're as far as Chapter 5 in the Fundamentals of Java AP* Computer Science Essentials for the A and AB exams.
The Answer to the Ultimate Question:

For rare M.U.G.E.N. characters, click here.
Last Edit: February 21, 2010, 05:09:18 am by Azasuke Kaijin
Re: Java Programming I don't get (Homework help basically)
#2  February 18, 2010, 09:34:16 pm
  • ******
  • 日本は素晴らしい国です。
So...do you want it straight up answered or to be taught what it is about?

And say functions instead of messages.
Re: Java Programming I don't get (Homework help basically)
#3  February 18, 2010, 09:37:16 pm
  • *****
  • Horrible
    • Sweden
    • http://network.mugenguild.com/anjel/
Well, if you don't get it, read about it and Google for code snippets you can look at. We won't do your homework for you.
My shitty mugen stuff:
Re: Java Programming I don't get (Homework help basically)
#4  February 19, 2010, 01:17:08 pm
  • ******
    • Germany
what the hell "messages"? is this supposed to make it easier to understand or something, picturing the objects as postmen for their class delivery services? o_O

anyways, really basic stuff. here's the first of the second question, hope you can work from there:
Code: (java)
Auto() {
  this.make = null;
  this.model = null;
  this.year = 0;
}
Re: Java Programming I don't get (Homework help basically)
New #5  October 01, 2010, 09:52:14 am
  • avatar
If you don't know what to do with your homework and even the people around you can’t teach you, the only way to solve your problem is to study. Make use of your computer, search on the internet, read your books and study well. Get some references in order for you to finish your homework in due time.

Last Edit: October 11, 2010, 08:21:55 pm by patricia39
Re: Java Programming I don't get (Homework help basically)
#6  October 04, 2010, 04:53:51 am
  • ***
  • +1 to whoever added Godzilla to the main index.
Don't you have any labs or examples you can go off of?
i think we should call it an "engine" so we don't look like total idiots because otherwise we'd be arguing about a "game" and that would be somehow "dumber" than arguing about an "engine" on the "internet" for countless hours

Iced said:
I for one, do not enjoy round corners!  :bigcry:
But they hurt much less when we accidentally hit them!  :S