Ciao ragazzi
.. ho un problemone .. ci sto sbattendo la testa ovunque,vi faccio subito vedere il problema ..
codice:
import java.util.Scanner;
class Strutture {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner tast=new Scanner (System.in);
int ff;
double Sp,Sp2,r1,r2,r3,r4;
System.out.print ("Spettatori ");
Sp=tast.nextDouble ();
Sp2=Sp*2.3;
System.out.print ("Livello Fast food ");
ff=tast.nextInt ();
if (ff==1) {
r1=(Sp2*4)*3+(45.000*2);
}
if (ff==2) {
r2=(Sp2*8)*3-(90.000*2);
}
if (ff==3) {
r3=(Sp2*12)*3-(135.000*2);
if (ff==4) {
r4=(Sp2*16)*3-(180.000*2);
}
if (r1>r2) {
System.out.print ("Livello 1");
System.out.print ("Ricavo bisettimanale: "+r1);
}
if (r2>r3) {
System.out.print ("Livello 2");
System.out.print ("Ricavo bisettimanale: "+r2);
}
if (r3>r4) {
System.out.print ("Livello 3");
System.out.print ("Ricavo bisettimanale: "+r3);
}
else {
System.out.print ("Livello 4");
System.out.print ("Ricavo bisettimanale: "+r4);
}
}
}
}
*Uso Eclipse*
errore:
Le variabili r1,r2,r3 ed r4 "may not ave been initialized" e vedendo su internet e la soluzione diretta di Eclipse mi fa mettere esempio r1=0 e così anche per le altre variabili ..
Il problema che non capisco il perchè me lo dichiara 0 se il suo valore non è tale numero 
Grazie per le risposte