Results 1 to 20 of 20
  1. #1
    GerD is offline Member
    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0

    Default help with basic code!!!

    Hi I'm new to java....first year college student and have an assignment to do. Really need help with this as I can't get it right. The assignment is below, any help on how to write this code from start to finish would be great

    Exercise 4.
    BigBurgers Ltd require a program to calculate their profit on hamburgers and chips each day.
    A portion of chips cost the company 30p and sells at 75p.
    A hamburger costs 40p and sells at 95p.
    Input to the program is the number of hamburgers and the number of portions of chips sold.
    Output is the profit on hamburgers, the profit on chips and the total profit.
    Follow the usual design code and test steps.

  2. #2
    Zyril is offline Senior Member
    Join Date
    Oct 2011
    Location
    Sweden
    Posts
    124
    Rep Power
    0

    Default Re: help with basic code!!!

    Hey!

    No one here will write the code for you, since you should be able to do it yourself when you are done with the assignment. Why are you taking a course if you don't want to learn how to code? ;)

    First, write down what type of calculations you need to do.
    Second, what do you need your program to do? It seems to me that you only have to input how many burgers and portions of chips that are sold, let the program calculate it and then print it out to the console.

    What "the usual design code and test steps" are I cannot answer you. If you have access to certain course literature, use it.

    What you need to know for this assignment is:

    How to make simple calculations in Java.
    How to take inputs from the console.
    How to write to the console.

    Good luck!

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: help with basic code!!!

    Quote Originally Posted by GerD View Post
    Hi I'm new to java....first year college student and have an assignment to do. Really need help with this as I can't get it right. The assignment is below, any help on how to write this code from start to finish would be great...
    Please have a look at this site So, You Need to Write a Program but Don't Know How to Start for tips on how to get started. Please feel free to come back with your code attempt if you have any specific answerable questions and we'll be more than happy to help you.

  4. #4
    GerD is offline Member
    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0

    Default Re: help with basic code!!!

    I don't want them to write the code for me I am only starting, of course I want to learn that's why I am taking it
    but what i am trying to say is I need to shown step by step first and I was not given that opportunity. Believe me I have
    asked the tutor for help as I am really struggling. I just don't understand the language if I knew that I could manage.

    Thanks for your reply though.

  5. #5
    GerD is offline Member
    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0

    Default Re: help with basic code!!!

    Thank you I am just starting and am under so much pressure, I just need the basics

  6. #6
    GerD is offline Member
    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0

    Default Re: help with basic code!!!

    Thank you

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: help with basic code!!!

    Quote Originally Posted by GerD View Post
    I don't want them to write the code for me I am only starting, of course I want to learn that's why I am taking it
    but what i am trying to say is I need to shown step by step first and I was not given that opportunity. Believe me I have
    asked the tutor for help as I am really struggling. I just don't understand the language if I knew that I could manage.
    Your question in its current state is really is little more than a homework dump, and about all it will elicit are general responses and links. In order for anyone to be able help you, you need to show the fruits of your efforts and ask as *specific* questions as possible.

  8. #8
    GerD is offline Member
    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0

    Default Re: help with basic code!!!

    just want to get this straight it's not a home work dump, I am new to this I don't know where to start.
    I have tried to work it out several times and am still trying, and I will keep trying until I get it I just have to get
    the steps right. Thanks

  9. #9
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,368
    Blog Entries
    7
    Rep Power
    20

    Default Re: help with basic code!!!

    Do you know how to add, subtract or multiply two numbers in Java and print the result?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  10. #10
    GerD is offline Member
    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0

    Default Re: help with basic code!!!

    To be honest No Jos, I know nothing about it I find it very hard, Its only my second week in college and got a CA to do.
    I never used Java before last week.

  11. #11
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,368
    Blog Entries
    7
    Rep Power
    20

    Default Re: help with basic code!!!

    Quote Originally Posted by GerD View Post
    To be honest No Jos, I know nothing about it I find it very hard, Its only my second week in college and got a CA to do.
    I never used Java before last week.
    Well, check you text book; you'll find a class in there with a main( ... ) method; copy that stuff to your own .java file but keep the body of that main( ... ) method empty; you have an (almost) empty class with a single (empty) method. You have to create the body of that method. Play with it a bit, try to compile and run what you did and see what happens; no need to worry, nothing explodes ;-)

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  12. #12
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: help with basic code!!!

    Also, if you're completely, totally and utterly lost, get a tutor for intense one on one face to face tutoring. Pay if you have to. This forum is no substitute for that.

  13. #13
    GerD is offline Member
    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0

    Default Re: help with basic code!!!

    thanks Jos appreciate it

  14. #14
    GerD is offline Member
    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0

    Default Re: help with basic code!!!

    I think you have me misunderstood Fubarable, I don't want you to be my teacher, were you never stuck before?

  15. #15
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: help with basic code!!!

    Quote Originally Posted by GerD View Post
    I think you have me misunderstood Fubarable, I don't want you to be my teacher, were you never stuck before?
    Yes, I've been stuck, but you're not stuck; to blunt you're completely lost. You're starting out and don't understand a thing about Java yet. Don't get me wrong, there's nothing wrong with that, as none of us are born with Java knowledge, but you must understand that a forum is not going to be able to help you at this stage. You first have to gain some basic understanding from your books, tutorials, lessons, ... enough to be able to formulate a specific question. If you're failing at even that, then you need one-on-one tutoring. Sorry, but that's how I see it.

  16. #16
    GerD is offline Member
    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0

    Default Re: help with basic code!!!

    No problem with that I am going through my books, and trying to get that understanding.
    I just thought you were being a bit arrogant.
    I have just booked some one to one lessons on-line so hope this will help me, Thanks

  17. #17
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: help with basic code!!!

    Quote Originally Posted by GerD View Post
    No problem with that I am going through my books, and trying to get that understanding.
    Good. Continued intense study will help. Also write lots and lots of code. Don't worry if its wrong to start with as the fixing of errors will help you learn the language.

    I just thought you were being a bit arrogant.
    Sorry if I gave that impression.

    I have just booked some one to one lessons on-line so hope this will help me, Thanks
    Great, and best of luck!

  18. #18
    GerD is offline Member
    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0

    Default Re: help with basic code!!!

    Thanks again

  19. #19
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: help with basic code!!!

    Quote Originally Posted by penguinCoder
    Here is your code, but you should really take everyone else's advice. Only reason I wrote it out for you is I like to write code, and rarely miss a chance to do so. Practice Practice Practice!....
    Code deleted. penguinCoder please do not spoon-feed solutions. By doing this you cheat the original poster out of a chance to "practice practice practice". Please no more of this here.

  20. #20
    neilq5 is offline Member
    Join Date
    Oct 2012
    Posts
    4
    Rep Power
    0

    Default Re: help with basic code!!!

    If you're really lost i'd recommend CodeMonkeyCharlie's youtube tutorials, they got me a pretty good start.
    He has 17 video's between 5 and 15 minutes each to cover all the basics.

    It might not be what you're looking for, for your assignment but I found it a great start into Java.

    I would post the link but i'm not sure if thats allowed!

Similar Threads

  1. need help with my basic java calculator code
    By hashey100 in forum New To Java
    Replies: 3
    Last Post: 11-12-2011, 04:48 PM
  2. Basic Java Calculator Code Problem
    By SerbianSergeant in forum New To Java
    Replies: 7
    Last Post: 07-22-2011, 01:50 PM
  3. very basic code
    By BlueJ2008 in forum New To Java
    Replies: 1
    Last Post: 10-14-2008, 01:40 PM
  4. help with basic java code
    By elizabeth in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:47 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •