Calculating a payment price based on a selected phone The program shows three phones with prices, and you need to select one of them. The program will then calculate the price based on the payment type you selected.

I'm very new to the world of OOP, and because I'm studying OOP on my own (I actually go to school and we have a computer subject, but I'm taking advance lessons on my own), I have no one to judge my code. I can make programs run, but I'm not sure if I am coding well.

Is there a better way I could have written this simple program? What are the conventions that I did not follow? I did my best based on things I read though, but I'm not sure if I missed things.

package javaPackage;
import java.util.Scanner;
import java.text.DecimalFormat;
public class OopApproach 
{
    private String model;
    private double price;
    private double discount;

    public OopApproach(String model,int price)
    {
        this.model=model;
        this.price=price;
    }
    public void setModel( String model )
    {
        this.model = model;
    }
    public void setPrice( double price )
    {
        this.price = price;
    }

    public static void main( String args[] )
    { 
        DecimalFormat df = new DecimalFormat("##.00");

        Scanner input=new Scanner(System.in);
        int selection;

        OopApproach iPhone = new OopApproach( "iPhone 6s", 299);
        OopApproach samsung = new OopApproach( "Samsung s6", 199);
        OopApproach lg = new OopApproach( "LG", 99 );

        System.out.println("Press 1:" + iPhone.model+" = " + "$" + df.format(iPhone.price));
        System.out.println("Press 2:" + samsung.model+" = " + "$" +df.format(samsung.price));
        System.out.println("Press 3:" + cherry.model+" = "+ "$" + df.format(lg.price));

        selection=input.nextInt();

        switch(selection)
        {
        case 1:System.out.println( "Your item is " + iPhone.model + " with price of " + "$" + df.format(iPhone.price));
        System.out.println();
        calcPrice(iPhone.model, iPhone.price); 
        break;
        case 2:System.out.println( "Your item is " + samsung.model + " with price of " + "$" + df.format(samsung.price));
        System.out.println();
        calcPrice(samsung.model, samsung.price);
        break;
        case 3:System.out.println( "Your item is " + lg.model + " with price of " + "$" + df.format(lg.price));
        System.out.println();
        calcPrice(cherry.model, lg.price);
        break;
        }
    }
        public static void calcPrice(String model,double price)
        {
            Scanner in=new Scanner(System.in);
            DecimalFormat dff=new DecimalFormat("##.00");
            int selec;
            double totalVal;

            System.out.println("Choose payment option");
            System.out.println("1:Cash - 5% discount");
            System.out.println("2:Installment, 3 months - 5% interest");
            System.out.println("3:Installment, 6 months - 10% interest");

            selec=in.nextInt();

            if(selec==1)
            {
                totalVal=price-(price*.05);
                System.out.print("You purchased " + model + " and the total cost is "+ "$" + dff.format(totalVal));
            }
            else if(selec==2)
            {
                totalVal=price+(price*.05);
                System.out.print("You purchased " + model + " and the total cost is "+ "$" + dff.format(totalVal));
            }
            else if(selec==3)
            {
                totalVal=price+(price*.10);
                System.out.print("You purchased " + model + " and the total cost is "+ "$" + dff.format(totalVal));
            }
    }
}


Output:




Press 1:iPhone 6s = $299.00
Press 2:Samsung s6 = $199.00
Press 3:LG = $99.00
1
Your item is iPhone 6s with price of $299.00

Choose payment option
1:Cash - 5% discount
2:Installment, 3 months - 5% interest
3:Installment, 6 months - 10% interest
1
 You purchased iPhone 6s and the total cost is $284.05
You have seemed to start off ok, by acknowledging that you need an object to hold the price and name of the phone.
You can separate this object's class, as others have mentioned, into another file and give it a more meaningful name (e.g. MobilePhone, Device, etc.)
Going back to the original problem, you need to calculate the final purchase price of a phone. According to your requirements, this final value might be influenced by the type of payment the user chooses (e.g Cash or Credit)
There's several ways you can approach your problem afterwards.
Example:
You can have an object that is responsible for calculating the final price of a phone based on the payment options. This might require you to create objects for the payment options as well.
(code below is missing some parts, like constructors, etc)
class PhonePriceCalculator {
    public double calcPrice(Phone phone, Cash cash) { }
    public double calcPrice(Phone phone, Credit cash) { }
}

// some classes to hold data
class Phone { }
class Cash { }
class Credit { }

Then, you just need to plug those objects in with your main() method. There are some improvements that you can make to code above.
For example, Cash is really just a type placeholder for calculating price. It never changes. Maybe you can model the Cash and Credit options through an enumeration. This will work just fine if there's only two credit types.
Another example:
Maybe modelling the price calculation through an object isn't so bad. But you didn't like the fact that we also have objects for the payment types (or an Enum if you decided to go for that instead). Well, you can simplify the price calculator by giving it a discount value instead:
class PhonePriceCalculator {
    public double calcPrice(Phone phone, double discount) { }
}

This way, this class doesn't need to know the payment type. Just the discount.
Final Considerations
I didn't touch private/public encapsulation because other users like Pimgd and Ethan Bierlien had already mentioned it. But again, it is wise to make fields inside an object private, and expose them through methods. Remember, the object is the owner of those fields. So it must choose to expose them (or not) consciously.
I know this is a toy example, but when you are dealing with money calculations in java, you're better of using the BigDecimal class instead of double. You can play with decimal scales, amongst other things.