Java program is not returning proper input
<p>Here are the three programs I had to create.</p>

<p>Program 1</p>

<pre><code>import java.util.Scanner; 
public class Order  
{  
    protected String customerName;  
    protected int customerNum, quantity;  
    protected double unitPrice, totalPrice;  
    Scanner input = new Scanner(System.in);

    public String getCustomerName()  
    {  
        return customerName;  
    }  
    public void setCustomerName()  
    {  
        System.out.println("Please enter customer name.");
        customerName = input.nextLine();  
    }  

    public int getCustomerNum()  
    {  
        return customerNum;  
    }  
    public void setCustomerNum()  
    {  
        System.out.println("Please enter customer number.");
        customerNum = input.nextInt();  
    }  

    public int getQuantity()  
    {  
        return quantity;  
    }  
    public void setQuantity()  
    {  
        System.out.println("Please enter quantity ordered.");
        quantity = input.nextInt();  
    }  

    public double getUnitPrice()  
    {  
        return unitPrice;  
    }  
    public void setUnitPrice()  
    { 
        System.out.println("Please enter unit price."); 
        unitPrice = input.nextDouble();  
    }  

    public void computePrice()  
    {  
        totalPrice = quantity * unitPrice;  
    }  

    public void displayInfo()  
    {  
        System.out.println("Customer Name : " +  
           customerName + "\nCustomer Number : " + customerNum +  
           "\nQuantity Ordered : " + quantity + "\nUnit Price : $" +  
           unitPrice  + "\nTotal Price : $" + totalPrice);  
    }  
}
</code></pre>

<p>Program 2</p>

<pre><code>import java.util.Scanner;  
public class ShippedOrder extends Order  
{  
    private double extraCharge = 4;  
    private double totalPrice1;  
    private String customerName1 = super.getCustomerName();  
    private int customerNum1 = super.getCustomerNum();  
    private int quantity1 = super.getQuantity();  
    private double unitPrice1 = super.getUnitPrice();  

    public void computePrice()  
    { 
        totalPrice1 = quantity1 * unitPrice1 + extraCharge;  
    }  

    public void displayInfo()
    {
        System.out.println("Customer Name : " +  
                    customerName1 + "\nCustomer Number : " +  
                    customerNum1 + "\nQuantity Ordered : " + quantity1 +  
                    "\nUnit Price : $" + unitPrice1  + "\nShipped Price : $"  
                    + extraCharge + "\nTotal Price : $" + totalPrice1);    
    }
}
</code></pre>

<p>Program 3</p>

<pre><code>import java.util.Scanner;
public class UseOrder
{
    public static void main(String[] args)
    {

        int num, q;
        String name, response;
        double p;
        char responseChar;
        Scanner keyboard = new Scanner(System.in);

        Order order1 = new Order();
        order1.setCustomerName();
        order1.setCustomerNum();
        order1.setQuantity();
        order1.setUnitPrice();
        order1.computePrice();
        order1.displayInfo();

        keyboard.nextLine(); 
        System.out.println("Do you need the shipping and handling service?");
        System.out.println("Enter y or n :");
        response = keyboard.nextLine();
        responseChar = response.charAt(0);
        if(responseChar == 'y')
        {
            ShippedOrder shippedorder1 = new ShippedOrder();
            shippedorder1.getCustomerName();
            shippedorder1.getCustomerNum();
            shippedorder1.getQuantity();
            shippedorder1.getUnitPrice();
            shippedorder1.computePrice();
            shippedorder1.displayInfo();

        }
    }
}
</code></pre>

<p>When I run UseOrder, it takes the first inputs and returns it correctly, but when I answer 'Y' to the shipping and handling question, it returns </p>

<pre><code>customer name : null
customer number: 0
Quantity Ordered: 0
Unit Price:0
Shipped Price: $4.0
Total Price: $4.0
</code></pre>
