ALGORITMO SECUENCIAL (Sistemas Contables)
- 2. 2) package problema.secuenc.pkg9;
importjava.io.*;
publicclassProblemaSecuenc9{
publicstaticvoidmain(String[] args)throwsIOException{
intsueldo,descuento;
floattotal;
BufferedReaderin=newBufferedReader(new InputStreamReader(System.in));
System.out.println("totalsueldo");
sueldo=Integer.parseInt(in.readLine());
descuento=Integer.parseInt(in.readLine());
total= sueldo-descuento;
System.out.println("totalsueldo"+descuento);
}
}
run:
totalsueldo
123
100
totalsueldo100
BUILD SUCCESSFUL (total time:7 seconds)
3) package problema.secuenc.pkg8;
importjava.io.*;
- 4. 4) package problema.secuenc.pkg7;
importjava.io.*;
publicclassProblemaSecuenc7{
publicstaticvoidmain(String[] args) throwsIOException{
inthora1,hora2,hora3;
floattotal;
BufferedReaderin=newBufferedReader(new InputStreamReader(System.in));
System.out.println("hora1,hora2,hora3");
hora1=Integer.parseInt(in.readLine());
hora2=Integer.parseInt(in.readLine());
hora3=Integer.parseInt(in.readLine());
total=hora1+hora2+hora3;
System.out.println("totalhoras"+total);
}
}
run:
hora1,hora2,hora3
23
45
67
total horas135.0
BUILD SUCCESSFUL (total time:6 seconds)
- 5. 5) package problema.secuenc.pkg6;
importjava.io.*;
publicclassProblemaSecuenc6{
publicstaticvoidmain(String[] args) throwsIOException{
introsa,maria,pablo,juan;
floatherencia;
BufferedReaderin=new BufferedReader(newInputStreamReader(System.in));
System.out.println("rosa,maria,pablo,juan");
rosa=Integer.parseInt(in.readLine());
maria=Integer.parseInt(in.readLine());
pablo=Integer.parseInt(in.readLine());
juan=Integer.parseInt(in.readLine());
herencia=rosa+maria+pablo+juan;
System.out.println("total herencia"+herencia);
}
}
run:
rosa,maria,pablo,juan
300
200
500
400
total herencia1400.0
BUILD SUCCESSFUL (total time:12 seconds)
- 7. 7) package problema.secuenc.pkg4;
importjava.io.*;
publicclassProblemaSecuenc4{
publicstaticvoidmain(String[] args)throwsIOException{
inthorasextras,comision,sueldobruto;
floattotal;
BufferedReaderin=new BufferedReader(newInputStreamReader(System.in));
System.out.println("horasextras,comision,sueldobruto");
horasextras=Integer.parseInt(in.readLine());
comision=Integer.parseInt(in.readLine());
sueldobruto=Integer.parseInt(in.readLine());
total=horasextras+comision+sueldobruto;
System.out.println("ganancia"+total);
}
}
run:
horasextras,comision,sueldobruto
40
70
39
ganancia149.0
BUILD SUCCESSFUL (total time:6 seconds