hi im doing a project in java and i would to know how do u create a restuarant bill calculator in java

Recommended Answers

All 3 Replies

You can start by explaining what a a restuarant bill calculator is?
After you explain it, start converting that explanation into java classes, and the calculations needed into methods.

Part 1 Create the Graphical User Interface
Create the graphical user interface as shown below. Provide only the functionality required to the display the completed JFrame and terminate the program if the JFrame is closed.

No layout manager should be used.

All GUI components should be positioned by program code. To do this remove the default layout manager with code like this:

waiterJPanel.setLayout( null );

All the GUI variables required are supplied in the code template. All the method headers are also provided.

Once you have removed the layout manager you can position each GUI item by using method setbounds, for example

beverageJLabel = new JLabel();
beverageJLabel.setBounds( 8, 24, 80, 24 );

Create a clear, easy to read font to display the information. Apply this font to all components.

Display the word Restaurant in a JLabel.

Create a JPanel waiterJPanel to display the Table Number and Waiter Name.

Create a JPanel named menuItemsJPanel to display the Beverage, Appetizer, Main Course and Desert combo boxes and associated labels.

Create a JButton to Calculate the bill, name it calculateBillJButton.

Then create text fields and labels to display the subtotal and total.

The GUI is illustrated in the screen shots below.

As you work through the project modify the import Statements provided so that only classes used are actually imported. The imports shown below should not appear in the final project.

import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.text.*;
import java.util.*;
import javax.swing.*;

So start by creating the GUI. Use the instructions of the assignment and/or add what you think that is necessary. The instructions tells you what the GUI must have so create those elements and add them to the gui. That would be the first step. Just create the GUI with no actions. Surely you have notes or you can find examples.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.