Quantcast

Maximum PC

It is currently Thu Apr 17, 2014 3:48 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: need java help
PostPosted: Thu Oct 07, 2004 4:23 pm 
Coppermine
Coppermine

Joined: Mon Jul 26, 2004 2:18 pm
Posts: 689
Location: South Elgin IL
so im in a beginers java program class and i need to create a program in java. the only problem is that i have no clue how to do it...i mean i have a small idea, and the conceps and commands make sense to me its just that when it comes to the actual writing of the program i am lost.

i have the assginment and if anybody wants to look at the requirements of the program they are here http://www.itk.ilstu.edu/faculty/mecali ... ogram3.doc i know it looks easy, but any help or ideas would be greatly appreciated!


Top
  Profile  
 
 Post subject:
PostPosted: Thu Oct 07, 2004 6:11 pm 
Team Member Top 100
Team Member Top 100

Joined: Fri Sep 17, 2004 5:35 pm
Posts: 1176
I'm not a Java programmer, so don't yell at me, but I think this is correct code and would get you started:
Code:
class Pizza
{
    int type;//holds the type
    float cost;//cost of the type
    int sales;//holds the total pizzas sold

    public:
    Pizza();//default constructor
    Pizza(int the_type, float the_cost);//constructor
    void sellPizza();//to sell 1 pizza
};

Pizza::Pizza()
{
    type=0;
    cost=0.0;
    sales=0.0;
//set all variables to 0
}

Pizza::Pizza(int the_type, float the_cost)
{
    type=the_type;
    cost=the_cost;
//set the cost and type
}

Pizza::sellPizza(int sold)
{
    sales+=sold;
//sell the # of pizzas
}
   


This is really C++ code, but I think it will work in Java.

Does this give you a start? I didn't do the whole thing -- there is still a lot left.


Top
  Profile  
 
 Post subject:
PostPosted: Thu Oct 07, 2004 9:15 pm 
Java Junkie
Java Junkie
User avatar

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24218
Location: Granite Heaven
Kybo ... C++ and java are similar, but not quite THAT similar.

The ideas are correct, though.

mustang: read the book. :)


Top
  Profile  
 
 Post subject:
PostPosted: Thu Oct 07, 2004 10:10 pm 
Coppermine
Coppermine

Joined: Mon Jul 26, 2004 2:18 pm
Posts: 689
Location: South Elgin IL
yeah sorry kybo, it didnt help much...but thanks for the suggestion. jipstyle, i tried reading my book, the only problem is that its so vague its hard to understand...not to mention that it doesnt go into great detail, so my assginment is to complex for anything the book can explain


im still open to suggestions though :D


Top
  Profile  
 
 Post subject:
PostPosted: Fri Oct 08, 2004 6:39 am 
Java Junkie
Java Junkie
User avatar

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24218
Location: Granite Heaven
The assignment isn't complex at all. This is a very basic Java programming assignment.

If your text sucks, I suggest you go and buy another or use the 'net as a resource ... there are lots of links provided in this folder as well as suggestions for texts and references for various programming languages.

For what I hope are obvious reasons, I'm not going to do your homework for you.


Top
  Profile  
 
 Post subject:
PostPosted: Fri Oct 08, 2004 3:32 pm 
Team Member Top 100
Team Member Top 100

Joined: Fri Sep 17, 2004 5:35 pm
Posts: 1176
Jipstyle wrote:
Kybo ... C++ and java are similar, but not quite THAT similar.

The ideas are correct, though.

mustang: read the book. :)

Lol, I made a disclaimer about it :lol:


Top
  Profile  
 
 Post subject:
PostPosted: Sun Oct 10, 2004 2:07 pm 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
94mustangv6 wrote:
yeah sorry kybo, it didnt help much...but thanks for the suggestion. jipstyle, i tried reading my book, the only problem is that its so vague its hard to understand...not to mention that it doesnt go into great detail, so my assginment is to complex for anything the book can explain


im still open to suggestions though :D

What book are you using? I find it hard to believe that your college(?) textbook doesn't provide enough detail to do this program. Of course, if you haven't read the textbook, this is entirely plausible.


Top
  Profile  
 
 Post subject:
PostPosted: Sun Oct 10, 2004 3:53 pm 
Java Junkie
Java Junkie
User avatar

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24218
Location: Granite Heaven
Kybo_Ren wrote:
Lol, I made a disclaimer about it :lol:


You did indeed. And to be fair, you provided more help that I have. :)

Of course, this is because I'm still scarred by memories of classmates 'sharing' assignments, and then bitching and moaning when they failed the 'hard' finals. :roll:

Wow. I'm all bitter and shit. Still. :lol:


Top
  Profile  
 
 Post subject: Re: need java help
PostPosted: Mon Oct 11, 2004 6:48 am 
Thunderbird
Thunderbird
User avatar

Joined: Wed Jul 07, 2004 1:13 pm
Posts: 817
Location: Missouri
94mustangv6 wrote:
so im in a beginers java program class and i need to create a program in java. the only problem is that i have no clue how to do it...i mean i have a small idea, and the conceps and commands make sense to me its just that when it comes to the actual writing of the program i am lost.

i have the assginment and if anybody wants to look at the requirements of the program they are here http://www.itk.ilstu.edu/faculty/mecali ... ogram3.doc i know it looks easy, but any help or ideas would be greatly appreciated!


Your book should have in chapter exercises that take you through creating your first program and explaining what you are doing. This is what my Intro to Java book did.

In one of the early chapter, it will take you through writing a hello world example. Do some of the in book exercises and end of chapter practice. This will go a long way to helping you.


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group