salut!
je suis grande débutantes en java et j'ai quelques problèmes avec 2programmes que j'essais de compiler voici les codes.
public class salaire
{
public static void main(String args[])
{
String[] employé=new String[3];
String[] taux=new String[3];
String[] nbrheure=new String[3];
int[] th=new int[3];
int[] heure=new int[3];
int[] heuresup=new int[3];
int[] salaire=new int[3];
for(int i=0;i<3;i++)
{
System.out.print("Nom employé\t Taux horaire\t Heures prester\t Salaire\n");
System.out.print(employé,"\t");
System.out.print(taux,"\t");
System.out.print(nbrheure,"\t");
System.out.print(taux,"\t");
heure[i]=Integer.parseInt(nbrheure[i]);
if(heure[i]<=40)
{
salaire[i]=heure[i]*th[i];
heuresup[i]=0;
}
else
{
heuresup[i]=heure[i]-40;
salaire[i]=(40+(heuresup[i]*(150/100)))*th[i];
}
}
}
}
import javax.swing.JOptionPane;
public class capital
{
public static void main(String args[])
{
String nbrannée,capital,taux;
float a,p,r;
int n,i;
capital=JOptionPane.showInputDialog("Entrer le capital investit\n");
nbrannée=JOptionPane.showInputDialog("Entrer le nombre d'année \n");
taux=JOptionPane.showInputDialog("Entrer le taux d'intérêt annuel\n");
p=Float.parseFloat(capital);
r=Float.parseFloat(taux);
n=Integer.parseInt(nbrannée);
JTextArea zoneaire = new JTextArea(11,20);
for(i=0;i<=n;i++)
{
a=p(Math.power((1+r),i));
zoneaire.append(i+"\t"+a);
}
JOptionPane.showMessageDialog(null,zoneaire,"intérêts composés",JOptionPane.INFORMATION_MESSAGE);
}
}
Partager