Merhaba İyi geceler;
Java ya yeni başladık biraz kendimi geliştirmeye çalışyorum . Ama yazdığım bir programda hata alıyorum. Program 'da 3 isci tipi farklı bir metodla işçilerin ması hesaplanıyor. 1.tip sadece mesaj çalışıyor ama 2 ve 3 tipte komisyon için sattığı ürün sayısını sormuyor. Yardım edebilecek varmı?
Alıntı
import java.util.Scanner;
public class Emp {
public static void main(String[] args) {
//
Scanner s = new Scanner(System.in);
int maas=1500;
int type = 1;
int b = 0;
int sell=0;
double c =Maas(maas,type,b,sell);
System.out.println("Lütfen İsim Girin");
String isim = s.nextLine();
System.out.println("Lütfen Kişi Tipini Giriniz ");
type = s.nextInt();
System.out.println(c);
}
public static double Maas( int a,int tip,int c,int sold ){
Scanner s = new Scanner(System.in);
a = 1500;
if (tip == 1){
return c=a ;
}
else if (tip == 2)
{
System.out.println("Toplam Kaç Ürün Sattı");
sold = s.nextInt();
return c= (int) (a + (sold*0.01));
}
else if (tip ==3)
{
System.out.println("Toplam Kaç Ürün Sattı");
sold = s.nextInt();
return c= (int) (sold*0.1);
}
return c;
}
}