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

Thread: Please help me with the java code bluej

  1. #1
    Junior Member
    Join Date
    Jun 2021
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Please help me with the java code bluej

    Create a program that will run a simple computation on ANY business logic.
    e.g. Restaurant Billing System
    Offer a Menu
    1. Burger 10.00
    2. Drinks 5.00
    3. Fries 1.50
    4. Pizza 7.50
    5. Ice Cream 4.00
    6. Chicken 15.00
    Ask for the number of ordered items.
    Compute for the Total Bill.
    Display the List of Items Ordered, as well as, Total Bill.
    Other possible concepts: Ordering System, Rental System, Reservation System etc.
    2. Computation should be placed in a function procedure.

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Please help me with the java code bluej

    What have you tried?
    Be sure to wrap all posted code in code tags.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Jun 2021
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Please help me with the java code bluej

    My problem is how is the computation in the end of the code


    package fastfood;
    import java.util.*;
    public class FastFood {
    public static void main(String[] args) {
    Scanner keyboard=new Scanner(System.in);
    double[] price={1.75,1.50,0.90,1.25,3.00,3.50,2.00,1.75};
    String[] food={"hotdog","fries","soda","cookie","pizza","bu rger",
    "taco","shake"};
    int selection=instructions();
    switch(selection) {
    case 1: printMenu(price,food); break;
    case 3: break;
    default: System.out.println("That is not a valid choice");
    }
    }
    public static int instructions() {
    Scanner keyboard=new Scanner(System.in);
    System.out.println("Automatted Fast Food");
    System.out.println("For the menu, press 1");
    System.out.println("To place an order, press 2");
    System.out.println("To place an order, press 3");
    int choice=keyboard.nextInt();
    return choice;
    }
    public static void printMenu(double[] cost, String[] items) {

    }
    }
    }

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Please help me with the java code bluej

    problem is how is the computation
    Can you explain what that computation needs to do?
    Can you do the computation by hand with paper and pen?

    Please edit your post and wrap your code with code tags:

    [code]
    **YOUR CODE GOES HERE**
    [/code]

    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    May 2022
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Re: Please help me with the java code bluej

    hello! may i ask how did you do your code ?? im confuse and we have given the same task also and im lost

Similar Threads

  1. Replies: 6
    Last Post: August 5th, 2014, 11:19 AM
  2. Replies: 4
    Last Post: January 24th, 2013, 11:20 AM
  3. Replies: 7
    Last Post: January 24th, 2013, 10:41 AM
  4. Trouble Porting my Java File Reading Code to Android Code
    By Gravity Games in forum Android Development
    Replies: 0
    Last Post: December 6th, 2012, 04:38 PM
  5. Replies: 3
    Last Post: September 3rd, 2012, 11:36 AM