Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

3] y> -2(x + 2)+6 vertex: (-2, 6) y-intercept: (0, 3 -2 -2 -3 2

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago