Results 1 to 5 of 5
  1. #1
    ITStudent is offline Member
    Join Date
    Jul 2013
    Posts
    25
    Rep Power
    0

    Default Programming Help

    Make a program for a pizzeria that will Checkboxes that will allow the user to use the sizes small 7 medium 9 large 11 extra large is 14 one of any number of toppings cheese free of charge 6 others that outputs a bill

  2. #2
    ITStudent is offline Member
    Join Date
    Jul 2013
    Posts
    25
    Rep Power
    0

    Default Re: Programming Help

    Here's the codes that I'm going to recycle for now.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;

    private class Pizzeria {
    private static void createWindow() {

    }
    {
    JMyNewHome window = new JMyNewHome();
    window.setVisible(true);
    }

    JCheckBox Pizza0 = new JCheckBox("Small-$7.00");
    JCheckBox Pizza1 = new JCheckBox("Medium-$9.00");
    JCheckBox Pizza2 = new JCheckBox("Large-$11.00");
    JCheckBox Pizza3 = new JCheckBox("Extra Large-$14.00");
    JLabel price = new JLabel("$0.00");
    Container contentPane = getContentPane();
    final int Pizza0= $7.00
    final int Pizza1 = $9.00
    final int Pizza2 = $11.00
    final int Pizza3 = $14.00
    int price = 0;
    */
    public JMyNewPizzeria()
    {
    setTitle("RJ's Pizzeria");
    setLayout(new FlowLayout());
    contentPane.add(Small);
    contentPane.add(Medium);
    contentPane.add(Large);
    contentPane.add(Extra Large);
    contentPane.add(price);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setSize(500,150);
    ButtonGroup house = new ButtonGroup();
    Pizzeria.add(Small);
    Pizzeria.add(Medium);
    Pizzeria.add(Large);
    Pizzeria.add(Extra Large);
    ClickButtonListener clickListener = new ClickButtonListener();
    Pizzeria.addActionListener(clickListener);
    Pizzeria.addActionListener(clickListener);
    Pizzeria.addActionListener(clickListener);
    Pizzeria.addActionListener(clickListener);
    }

    public class ClickButtonListener implements ActionListener
    {
    public void actionPerformed(ActionEvent e)
    {
    Object o = e.getSource();
    if(o==aspen)
    {
    if(aspen.isSelected())
    {
    int hprice = 100000;
    }
    }
    else if(o==brittany)
    {
    if(brittany.isSelected())
    {
    int hprice = 120000;
    }
    }
    else if(o==colonial)
    {
    if(colonial.isSelected())
    {
    int hprice = 180000;
    }
    }
    else if(o==dartmoor)
    {
    if(dartmoor.isSelected())
    {
    int hprice = 250000;
    }
    }
    else if(o==twobed)
    {
    if(twobed.isSelected())
    {
    int bprice = 21000;
    }
    }
    else if(o==threebed)
    {
    if(threebed.isSelected())
    {
    int bprice = 31500;
    }
    }
    else if(o==fourbed)
    {
    if(fourbed.isSelected())
    {
    int bprice = 42000;
    }
    }
    else if(o==carzero)
    {
    if(carzero.isSelected())
    {
    int cprice = 0;
    }
    }
    else if(o==carone)
    {
    if(carone.isSelected())
    {
    int cprice = 7775;
    }
    }
    else if(o==cartwo)
    {
    if(cartwo.isSelected())
    {
    int cprice = 15550;
    }
    }
    else if(o==carthree)
    {
    if(carthree.isSelected())
    {
    int cprice = 23325;
    }
    }
    price.setText(hprice+bprice+cprice);

    }
    }

    }
    import java.awt.Font;
    import java.awt.LayoutManager;

    import javax.swing.*;
    public class SecondTrial
    {
    public static void main(String[] args)
    {
    JFrame aFrame = new JFrame("Nursery Rhyme");
    aFrame.setSize(250,100);
    aFrame.setVisible(true);

    final int FRAME_WIDTH = 300;
    final int FRAME_HEIGHT = 150;
    Font HeadlineFont = new Font("Arial", Font.BOLD, 17);
    JFrame aFrame10 = new JFrame("My Nursery Rhyme");
    aFrame10.setSize(FRAME_WIDTH, FRAME_HEIGHT);
    aFrame10.setVisible(true);
    aFrame10.setDefaultCloseOperation(JFrame.EXIT_ON_C LOSE);
    JLabel greeting = new JLabel("Jack Be Nimble");
    greeting.setFont(new Font("Arial",Font.BOLD,17));
    aFrame10.add(greeting);
    Font HeadlineFont1 = new Font("Times New Roman", Font.BOLD, 36);
    JLabel aFrame0 = new JLabel("Jack be Nimble");
    JLabel aFrame1 = new JLabel("Jack, be nimble,");
    JLabel aFrame2= new JLabel("Jack, be quick,");
    JLabel aFrame3 = new JLabel("Jack, jump over");
    JLabel aFrame4 = new JLabel("The candlestick. Jack jumped high");
    JLabel aFrame5 = new JLabel("Jack jumped low");
    JLabel aFrame6 = new JLabel("Jack jumped over");
    JLabel aFrame7= new JLabel("Jack jumped over");
    JLabel aFrame8= new JLabel("Jack be Nimble");
    greeting.setFont(new Font("Times New Roman",Font.BOLD,36));
    aFrame10.setLayout(SetLayout());
    aFrame10.add(aFrame0);
    aFrame10.add(aFrame1);
    aFrame10.add(aFrame2);
    aFrame10.add(aFrame3);
    aFrame10.add(aFrame4);
    aFrame10.add(aFrame5);
    aFrame10.add(aFrame6);
    aFrame10.add(aFrame7);
    aFrame10.add(aFrame8);
    }

    private static LayoutManager SetLayout() {
    // TODO Auto-generated method stub
    return null;
    }
    }

  3. #3
    ITStudent is offline Member
    Join Date
    Jul 2013
    Posts
    25
    Rep Power
    0

    Default Re: Programming Help

    Here's the codes I'm going to recycle for this program
    Java Code:
    import java.awt.*;
    import javax.swing.*; 
    import java.awt.event.*;
    	
    private class Pizzeria {
    	 private static void createWindow() {
    		 
    	 }
    	    {
    	    	JMyNewHome window = new JMyNewHome();
    	    	window.setVisible(true);
    	    }
    	 
    		JCheckBox Pizza0 = new JCheckBox("Small-$7.00");
    		JCheckBox Pizza1 = new JCheckBox("Medium-$9.00");
    		JCheckBox Pizza2 = new JCheckBox("Large-$11.00");
    		JCheckBox Pizza3 = new JCheckBox("Extra Large-$14.00");
    		JLabel price = new JLabel("$0.00");
    		Container contentPane = getContentPane();
    		final int Pizza0= $7.00
    		final int Pizza1 = $9.00
    		final int Pizza2 = $11.00
    		final int Pizza3 = $14.00
    		int price = 0;
    	*/	
    	    public JMyNewPizzeria()
    	    {
    	    	setTitle("RJ's Pizzeria");
    	        setLayout(new FlowLayout());
    	        contentPane.add(Small);
    	    	contentPane.add(Medium);
    	    	contentPane.add(Large);
    	    	contentPane.add(Extra Large);
    	    	contentPane.add(price);
    	        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    	        setSize(500,150);
    	        ButtonGroup house = new ButtonGroup();
    	        Pizzeria.add(Small);
    	        Pizzeria.add(Medium);
    	        Pizzeria.add(Large);
    	        Pizzeria.add(Extra Large);
    			ClickButtonListener clickListener = new ClickButtonListener();
    			Pizzeria.addActionListener(clickListener);
    			Pizzeria.addActionListener(clickListener);
    			Pizzeria.addActionListener(clickListener);
    			Pizzeria.addActionListener(clickListener);
    	    }
    	 
    		 public class ClickButtonListener implements ActionListener
    		 {
    		 	public void actionPerformed(ActionEvent e)
    	    	{
    	    		Object o = e.getSource();
    	    		if(o==aspen)
    	    		{
    	    			if(aspen.isSelected())
    	    			{
    	    			int hprice = 100000;	
    	    			}
    	    		}
    	    		else if(o==brittany)
    	    		{
    	    			if(brittany.isSelected())
    	    			{
    	    			int hprice = 120000;		
    	    			}
    	    		}
    	    		else if(o==colonial)
    	    		{
    	    			if(colonial.isSelected())
    	    			{
    	    			int hprice = 180000;
    	    			}	
    	    		}
    	    		else if(o==dartmoor)
    	    		{
    	    			if(dartmoor.isSelected())
    	    			{
    	    			int hprice = 250000;	
    	    			}
    	    		}
    	    		else if(o==twobed)
    	    		{
    	    			if(twobed.isSelected())
    	    			{
    	    			int bprice = 21000;	
    	    			}
    	    		}
    	    		else if(o==threebed)
    	    		{
    	    			if(threebed.isSelected())
    	    			{
    	    			int bprice = 31500;
    	    			}	
    	    		}
    	    		else if(o==fourbed)
    	    		{
    	    			if(fourbed.isSelected())
    	    			{
    	    			int bprice = 42000;	
    	    			}
    	    		}
    	    		else if(o==carzero)
    	    		{
    	    			if(carzero.isSelected())
    	    			{
    					int cprice = 0;
    	    			}	
    	    		}
    	    		else if(o==carone)
    	    		{
    	    			if(carone.isSelected())
    	    			{
    	    			int cprice = 7775;	
    	    			}
    	    		}
    	    		else if(o==cartwo)
    	    		{
    	    			if(cartwo.isSelected())
    	    			{
    	    			int cprice = 15550;	
    	    			}
    	    		}
    	    		else if(o==carthree)
    	    		{
    	    			if(carthree.isSelected())
    	    			{
    	    			int cprice = 23325;	
    	    			}
    	    		}
    	    		price.setText(hprice+bprice+cprice);
    	    		
    		 	}
    		 }
    	 
    	}
    import java.awt.Font;
    import java.awt.LayoutManager;
    
    import javax.swing.*;
    public class SecondTrial 
    {
    	public static void main(String[] args)
    	{
    		JFrame aFrame = new JFrame("Nursery Rhyme");
    		aFrame.setSize(250,100);
    		aFrame.setVisible(true);
    
    				final int FRAME_WIDTH = 300;
    				final int FRAME_HEIGHT = 150;
    				Font HeadlineFont = new Font("Arial", Font.BOLD, 17);
    				JFrame aFrame10 = new JFrame("My Nursery Rhyme");
    				aFrame10.setSize(FRAME_WIDTH, FRAME_HEIGHT);
    				aFrame10.setVisible(true);
    				aFrame10.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    				JLabel greeting = new JLabel("Jack Be Nimble");
    				greeting.setFont(new Font("Arial",Font.BOLD,17));
    				aFrame10.add(greeting);
    				Font HeadlineFont1 = new Font("Times New Roman", Font.BOLD, 36);
    				JLabel aFrame0 = new JLabel("Jack be Nimble");
    				JLabel aFrame1 = new JLabel("Jack, be nimble,");
    				JLabel aFrame2= new JLabel("Jack, be quick,");
    				JLabel aFrame3 = new JLabel("Jack, jump over");
    				JLabel aFrame4 = new JLabel("The candlestick. Jack jumped high");
    				JLabel aFrame5 = new JLabel("Jack jumped low");
    				JLabel aFrame6 = new JLabel("Jack jumped over");
    				JLabel aFrame7= new JLabel("Jack jumped over");
    				JLabel aFrame8= new JLabel("Jack be Nimble");
    				greeting.setFont(new Font("Times New Roman",Font.BOLD,36));
    				aFrame10.setLayout(SetLayout());
    				aFrame10.add(aFrame0);
    				aFrame10.add(aFrame1);
    				aFrame10.add(aFrame2);
    				aFrame10.add(aFrame3);
    				aFrame10.add(aFrame4);
    				aFrame10.add(aFrame5);
    				aFrame10.add(aFrame6);
    				aFrame10.add(aFrame7);
    				aFrame10.add(aFrame8);
    			}
    
    }

  4. #4
    ITStudent is offline Member
    Join Date
    Jul 2013
    Posts
    25
    Rep Power
    0

    Default Re: Programming Help

    Help me if you can, I'm feeling down
    And I do appreciate you being 'round
    Help me get my feet back on the ground
    Won't you, please, please help me?
    Help me, help me

  5. #5
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,800
    Rep Power
    7

    Default Re: Programming Help

    Help you with what? All you have done is post the assignment and a gazillion lines of code. What you have not done is ask a specific question.

Similar Threads

  1. Replies: 1
    Last Post: 04-20-2013, 10:16 PM
  2. Replies: 1
    Last Post: 04-20-2013, 10:15 PM
  3. android programming vs game programming using java
    By vgoel38 in forum Forum Lobby
    Replies: 2
    Last Post: 09-08-2012, 01:11 AM
  4. programming
    By shazeb in forum New To Java
    Replies: 9
    Last Post: 10-31-2010, 03:45 PM

Posting Permissions

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