dimanche 23 octobre 2016

if else java help please

Hi All I'm new to Java but I'm lost on the below code can someone help its not printing out the cost

boolean Smart;
boolean Flat;
int smallsmart = 322;
int largesmart = 405;

void price(){
    Scanner in = new Scanner(System.in);
    System.out.printf("%nWhat Type of TV would you like Smart of Flat ???  ");//Prompts
    boolean TV = in.next() != null;

    System.out.println("What Size would you like 32 or 42 inch ?? ");//Prompts
    int Size = in.nextInt();    

    if (TV = Smart && Size == 32){//start of if 
        System.out.println("The Price of your Tv is " + smallsmart);    
    } else if (TV = Smart & Size == 42){//start of if 
        System.out.println("The Price of your Tv is " + largesmart);
    }

Aucun commentaire:

Enregistrer un commentaire