In the method `askCarType()` and `askSolarPanel()` the inputdialog both run two times, once in their own method and once more in the final method `PrintOptions()`.

I need them to only run once, and that is in the final method `PrintOptions()`.

How can I do that?

```
import javax.swing.*;

public class short7 {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub

        PrintOptions();

    }// ends main

    public static String askCarType() {
        String typeOfCar;
        typeOfCar = JOptionPane.showInputDialog("Electric or Hybrid?");
        if (!typeOfCar.equals("Electric")
                && (!typeOfCar.equals("electric") && (!typeOfCar
                        .equals("Hybrid") && (!typeOfCar.equals("hybrid"))))) {
            JOptionPane
                    .showMessageDialog(null,
                            "You have to choose either an Electric or Hybrid type of car.");
            typeOfCar = JOptionPane.showInputDialog("Electric or Hybrid?");
        }
        return typeOfCar;
    }// ends askCarType

    public static String askSolarPanel() {
        String wantSolarPanel;
        wantSolarPanel = JOptionPane
                .showInputDialog("Do you want a Solar Panel?");
        if (!wantSolarPanel.equals("Yes")
                && (!wantSolarPanel.equals("yes") && (!wantSolarPanel
                        .equals("No") && (!wantSolarPanel.equals("no"))))) {
            JOptionPane.showMessageDialog(null,
                    "You have to enter either Yes or No");
            wantSolarPanel = JOptionPane
                    .showInputDialog("Do you want a Solar Panel?");
        }
        return wantSolarPanel;
    }// ends askSolarPanel

    public static int calculateDiscount() {
        String typeOfCarSelected = askCarType();
        String SolarPanelSelected = askSolarPanel();
        int Discount = 0;
        if ((typeOfCarSelected.equals("Electric") || typeOfCarSelected
                .equals("electric"))
                && ((SolarPanelSelected.equals("Yes") || SolarPanelSelected
                        .equals("yes")))) {
            Discount = 500;
        } else {
            Discount = 0;
        }
        return Discount;
    }// ends calculateDiscount

    public static int CalculateCost() {
        String typeOfCarCost = askCarType();
        String SolarPanelCost = askSolarPanel();
        final int basicPrice = 20000;
        final int ElectricModel = 2000;
        final int SolarPanel = 5000;
        final int Discount = calculateDiscount();
        int total = 0;

        if ((typeOfCarCost.equals("Electric") || typeOfCarCost
                .equals("electric"))
                && ((SolarPanelCost.equals("No") || SolarPanelCost.equals("no")))) {
            total = basicPrice + ElectricModel;
            System.out.println("Basic Price:" + basicPrice);
            System.out.println("Electric Model:" + ElectricModel);
            System.out.println("Total:" + total);

        } else if ((typeOfCarCost.equals("Electric") || typeOfCarCost
                .equals("electric"))
                && ((SolarPanelCost.equals("Yes") || SolarPanelCost
                        .equals("yes")))) {
            total = basicPrice + ElectricModel + SolarPanel - Discount;
            System.out.println("Basic Price:" + basicPrice);
            System.out.println("Electric Model:" + ElectricModel);
            System.out.println("Solar Panel:" + SolarPanel);
            System.out.println("Discount:" + Discount);
            System.out.println("Total:" + total);
        } else {
            total += basicPrice;
            System.out.println("Basic Price:" + basicPrice);
            System.out.println("Total:" + total);
        }
        return total;
    }// ends CalculateCost

    public static void PrintOptions() {
        CalculateCost();
    }// ends PrintOptions

}// ends class short7

```