Question: How to get my code into GUI modality?? I need my code to produce this. This is my code so far: This is the basic
How to get my code into GUI modality??


I need my code to produce this.
This is my code so far:



This is the basic skeleton that I need the code to follow:
package PRJ2;
public class PRJ2 {
public static class Automobile {
}// End Automobile
public static class Electric extends Automobile {
}// End Electric
public static class Hybrid extends Automobile {
}// End Hybrid
public static void main (String [] args) {
-
Declare array
-
Create an object of JFrame class
-
Coding for the window
-
Action Listeners
-
Remaining code for the GUI structure
} // End main ()
The bold part is the part I am having issues with. Please help!!! You will receive positive feedback from me.
Automobile Sales Tax Calculator - x Make and Model Ford Fusion Sales Price 21000 Automobile Type O Hybrid Miles per Gallon Electric Weight in Pounds Other Compute Sales tax 1050.00 Clear Fields Display Report Automobile Sales Tax Calculator -ox Make and Model Sales Price Automobile Type O Hybrid Miles per Gallon Electric Weight in Pounds Other Compute Sales tax Clear Fields Display Report package PRJ2; public class PRJ2 public static class Automobile { //set visibility as protected to //access from sub classes electric and Hybrid protected String make; protected String model; protected double purchase Price; protected final double TAX_RATE=0.05; /*Automobile constructor*/ public Automobile(String make, String model, double price) this.make=make; this.model=model; this.purchasePrice=price; /Override the sales Tax method*/ public double sales Tax() { return purchasePrice * TAX_RATE; /*Override to String method*/ public String toString return String.format("Make: %s Model: %s Sales: $%.2f Sales tax: $%.2f", make, model, purchasePrice, sales Tax(); public static class Electric extends Automobile { I/instance variable private int weight; /* constructor*/ public Electric(String make, String model, double price, int weight){ super(make, model, price); this.weight=weight; public double sales Tax() { double discount=0; double tax=purchasePrice TAX_RATE; if(weight
Step by Step Solution
There are 3 Steps involved in it
Lets build the complete solution to convert your existing code into a GUIbased Automobile Sales Tax Calculator using the exact structure you provided and following the images you attached COMPLETE COD... View full answer
Get step-by-step solutions from verified subject matter experts
