Results 1 to 9 of 9
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: java homework help

  1. #1
    keirax3x3 is offline Member
    Join Date
    May 2015
    Posts
    3
    Rep Power
    0

    Default java homework help

    I have a java eclipse homework but I don't know how to input a 10 % discount if the user is a student. Is anybody kind enough to explain this part or even show the whole programming output? Thanks :)





    Write a program that does the following:
    - Display a menu in the following manner: 1. Hamburger 2. Cheeseburger 3. French Fries 4. Soft drinks
    - Read in the option entered by the user
    - Prompt and read in the quantity that the user wants to order.
    - Ask the user if he/she is a student. Give a 10% discount if the user is a student.
    - Display the userís order and the amount of money he has to pay.
    The following table is the price of the item:
    Item
    Price
    Hamburger
    $1.50
    Cheese Burger
    $2.00
    French Fries
    $2.40
    Soft drinks
    $1.95

    The following is a sample of the program output:
    Menu
    ====
    1. Hamburger
    2. Cheeseburger
    3. French Fries
    4. Soft drinks
    Enter your choice (1,2,3 or 4): 3
    Enter the quantity of your order 2
    Are you a student (yes/no) y
    You bought 2 french fries
    You have to pay total of $4.32
    Last edited by JosAH; 05-19-2015 at 06:13 PM. Reason: i got it

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: java homework help

    how to input a 10 % discount
    Is that the same as paying 90% of the price instead of the full price?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    keirax3x3 is offline Member
    Join Date
    May 2015
    Posts
    3
    Rep Power
    0

    Default Re: java homework help

    Yes 90% :)

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: java homework help

    Do you know how to compute 90% of a value?
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    keirax3x3 is offline Member
    Join Date
    May 2015
    Posts
    3
    Rep Power
    0

    Default Re: java homework help

    No, I do not know how to.

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: java homework help

    Quote Originally Posted by keirax3x3 View Post
    No, I do not know how to.
    Not even on paper?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,423
    Blog Entries
    7
    Rep Power
    27

    Default Re: java homework help

    @OP: please don't remove the original content of your thread; others might stumble upon this thread (possibly through Google), only to find a headless and therefor useless thread; I put back the original content.

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

  8. #8
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: java homework help

    Not that there is even a fiber of value now. Just another 'do my homework' thread.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  9. #9
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: java homework help

    Yeh but the thread now has pictures of Norm, Jos and me :D
    gimbal2 likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Need HW help on java homework
    By sourlemons in forum New To Java
    Replies: 3
    Last Post: 10-16-2010, 05:44 AM
  2. Need help with my java homework.
    By nightrise420 in forum New To Java
    Replies: 6
    Last Post: 09-24-2010, 07:23 PM
  3. java homework help
    By jenniferrlie in forum New To Java
    Replies: 5
    Last Post: 09-22-2009, 08:12 PM
  4. Java homework please
    By Indulgence in forum New To Java
    Replies: 1
    Last Post: 11-03-2008, 02:48 AM
  5. LF: Homework help with Java
    By excurssion in forum New To Java
    Replies: 2
    Last Post: 10-17-2008, 06:00 AM

Posting Permissions

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