Question
Joes Automotive Joes Automotive performs the following routine maintenance services: Oil change: $26.00 Lube job: $18.00 Radiator flush: $30.00 Transmission flush: $80.00 Inspection: $15.00 Muffler
Joes Automotive Joes Automotive performs the following routine maintenance services: Oil change: $26.00 Lube job: $18.00 Radiator flush: $30.00 Transmission flush: $80.00 Inspection: $15.00 Muffler replacement: $100.00 Tire rotation: $20.00 Joe also performs other nonroutine services and charges for parts and labor ($20 per hour). Create a GUI application that displays the total for a customers visit to Joes. (Java)
repairs.java
import javax.swing.*; import java.awt.event.*;
public class repairs extends JFrame { private final double OILCHANGE = 26.00; private final double LUBE = 18.00; private final double RADIATOR = 30.00; private final double TRANSMISSION = 80.00; private final double INSPECTION = 15.00; private final double MUFFLER = 100.00; private final double TIRE = 20.00;
private final int WINDOW_HEIGHT = 500; private final int WINDOW_WIDTH = 250;
private JPanel panel; private JTextField hours;
private JButton Oil; private JButton Lube; private JButton Radiator; private JButton Transmission; private JButton Inspection; private JButton Muffler; private JButton Tire;
public repairs() { setTitle("Travel Expenses Calculator"); setSize(WINDOW_WIDTH, WINDOW_HEIGHT); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); buildPanel(); add(panel); setVisible(true); }
public void buildPanel() { Oil = new JButton("Oil Change"); Tire = new JButton("Tire Rotation"); Lube = new JButton("Lube Job"); Inspection = new JButton("Vehicle Inspection"); Radiator = new JButton("Radiator Flush"); Muffler = new JButton("Muffler Replacement"); Transmission = new JButton("Transmission Flush"); Oil.addActionListener(new ActionListener()); Tire.addActionListener(new ActionListener()); Lube.addActionListener(new ActionListener()); Inspection.addActionListener(new ActionListener()); Radiator.addActionListener(new ActionListener()); Muffler.addActionListener(new ActionListener()); Transmission.addActionListener(new ActionListener()); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started