Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Chapter 4: Sales Commission
- Programmer: K. Klug
- Date: August 14, 2013
- Filename: Commission.java
- Purpose: This applet calculates sales commission using a sales amount
- (input by the user) and a sales code (chosen from among option buttons).
- */
- import java.awt*;
- import java.applet.*;
- import java.awt.event.*;
- import java.text.DecimalFormat;
- public class CommissionApplet extends Applet implements ItemListener
- {
- //declare variables and construct a color
- double dollars, answer;
- int empCode;
- Image dollarSign;
- Color darkRed = new Color(160, 50, 0);
- //Create components for applet
- Label promptLabel = new Label("Enter the sales amount (do not use commas or dollar signs):")
- TextField salesField = new TextField(20);
- Label codeLabel = new Label("Select the appropriate commission code:");
- CheckboxGroup codeGroup = new CheckboxGroup();
- Checkbox telephonebox = new Checkbox("Telephone Sales",false,codeGroup);
- Checkbox inStoreBox = new Checkbox("In-Store Sales",false,codeGroup);
- Checkbox outsideBox = new Checkbox("Outside Sales",false,codeGroup);
- Checkbox hiddenBox = new Checkbox("",true,codeGroup);
- Label outputLabel = new Label("Click an option button to calculate the sales commission.");
- public void init()
- {
- setBackground(darkRed);
- setForeground(Color.white);
- add(promptLabel);
- add(salesField);
- salesField.requestFocus();
- salesField.setForeground(Color.black);
- add(codeLabel);
- add(telephoneBox);
- telephoneBox.addItemListener(this);
- add(inStoreBox);
- inStoreBox.addItemListener(this);
- add(outsideBox);
- outsideBox.addItemListener(this);
- add(outputLabel);
- }
- //This method is triggered by the user clicking an option button
- public void itemStateChanged(ItemEvent choice)
- }
- {
- }
- ==================
- Progressed until Page 273,
- http://pastebin.com/YEqMuTiC is the containing code(?)
- Stopped at Figure 4-46asjkbbbbbbbbbb
- something.
- idfk.
- sleep.
- i need it
Advertisement
Add Comment
Please, Sign In to add comment