Skateboard produts DECKs ,Truck Assemblies , Wheels The Master Thrasher $60 , TA
ID: 3635105 • Letter: S
Question
Skateboard produts
DECKs ,Truck Assemblies , Wheels
The Master Thrasher $60 , TA=7.75 inch axle $35 Wheels= 51mm $20
The dictator $45, TA=8 inch axle $40 wheel = 55mm$22
The Street King $50 TA= 8.5 inch axle $45 Wheel=61mm$28
In addition, the skate shop sells the following miscellanceous products and services:
Grip tape: $10
Bearings: $30
Riser Pads:$2
Nuts $ Bolts kit: $3
create an application that allows the user to select one deck, one truck assembly, and one wheel set from either list components or combo boxes. The application should also have a list component that allows the user to select multiple miscellaneous products. The application should display the subtotal, the amount of sales tax (at 6 percent), and the total of the order
Thanks
Explanation / Answer
Hope this is it, please rate! import java.awt.Color; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.ListSelectionModel; public class Skateboards extends JFrame implements ActionListener{ public JComboBox wheels; public JComboBox trucks; public JComboBox decks; public JLabel deckLabel; public JLabel truckLabel; public JLabel wheelLabel; public JLabel miscLabel; public JLabel subLabel; public JLabel subtotal; public JLabel totalLabel; public JLabel total; public JLabel taxLabel; public JLabel tax; public JList misc; public JButton calculate; public String []deckString = {"Master Thrasher", "Dictator", "Street King"}; public String[] truckString = {"7.75 inch axle", "8 inch axle", "8.5 inch axle"}; public String[] wheelString = {"51 mm", "55 mm", "61 mm"}; public String[] miscString = {"Grip Tape", "Bearings","Riser Pads", "Nuts and Bolts Kit"}; public int[] deckPrices = {60, 45, 50}; public int[] truckPrices = {35, 40, 45}; public int[] wheelPrices = {20, 22, 28}; public int[] miscPrices = {10, 30, 2, 3}; public Skateboards(){ setSize(550,300); setTitle("Skateboard Shop"); setLocation(150,150); Container contentPane = getContentPane(); contentPane.setLayout(null); contentPane.setBackground(Color.WHITE); deckLabel = new JLabel("Decks:"); deckLabel.setBounds(57,17,80,25); contentPane.add(deckLabel); decks = new JComboBox(deckString); decks.setBounds(5,40,150, 25); contentPane.add(decks); decks.setSelectedIndex(2); truckLabel = new JLabel("Trucks:"); truckLabel.setBounds(240,17,80,25); contentPane.add(truckLabel); trucks = new JComboBox(truckString); trucks.setBounds(190,40,150, 25); contentPane.add(trucks); trucks.setSelectedIndex(2); wheelLabel = new JLabel("Wheels:"); wheelLabel.setBounds(430,17,80,25); contentPane.add(wheelLabel); wheels = new JComboBox(wheelString); wheels.setBounds(375,40,150, 25); contentPane.add(wheels); wheels.setSelectedIndex(2); misc = new JList(miscString); //data has type Object[] misc.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); misc.setLayoutOrientation(JList.HORIZONTAL_WRAP); misc.setVisibleRowCount(-1); misc.setBounds(200, 100, 160, 80); contentPane.add(misc); miscLabel = new JLabel("Miscellaneous Services:"); miscLabel.setBounds(190,75, 150, 25); contentPane.add(miscLabel); subLabel = new JLabel("Subtotal: "); subLabel.setBounds(150,210,120,25); contentPane.add(subLabel); totalLabel = new JLabel("Total: "); totalLabel.setBounds(170, 250, 120, 25); contentPane.add(totalLabel); total = new JLabel(); total.setBounds(210, 250, 120, 25); contentPane.add(total); subtotal = new JLabel(); subtotal.setBounds(210, 210, 80, 25); contentPane.add(subtotal); taxLabel = new JLabel("Tax: "); taxLabel.setBounds(175,230,80,25); contentPane.add(taxLabel); tax = new JLabel(); tax.setBounds(210, 230, 80, 25); contentPane.add(tax); calculate = new JButton("Calculate"); calculate.setBounds(200,180,120,25); contentPane.add(calculate); calculate.addActionListener(this); } public static void main(String[] args) { Skateboards shop = new Skateboards(); shop.setVisible(true); shop.setDefaultCloseOperation(EXIT_ON_CLOSE); } @Override public void actionPerformed(ActionEvent arg0) { calculateTotal(); } public void calculateTotal(){ int wheelIndex = wheels.getSelectedIndex(); int deckIndex = decks.getSelectedIndex(); int truckIndex = trucks.getSelectedIndex(); int[] miscArray = misc.getSelectedIndices(); int miscTotal = 0; for(int i =0; iRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.