SlideShare a Scribd company logo
1 of 10
ALGORITMO SECUENCIAL
1)package problemacondic10;
importjavax.swing.JOptionPane;
publicclassProblemacondic10{
publicstaticvoidmain(String[] args) {
Stringp;
intbarcos, tpagar;
p=JOptionPane.showInputDialog("¿cuantasbarcosse compraron?");
barcos=Integer.parseInt(p);
if (barcos<8){
tpagar=barcos*10000;
}else {
tpagar=barcos*1600;
}
JOptionPane.showMessageDialog(null,"el total que se debe pagares$"+tpagar);
}
}
run:
ingresanota1,nota2,nota3
12
13
15
nota promedio30.0
BUILD SUCCESSFUL (total time:5 seconds)
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.*;
publicclassProblemaSecuenc8{
publicstaticvoidmain(String[] args)throwsIOException{
inttelevisor,radio;
floatcompra;
BufferedReaderin=new BufferedReader(newInputStreamReader(System.in));
System.out.println("total de compra");
televisor=Integer.parseInt(in.readLine());
radio=Integer.parseInt(in.readLine());
compra=televisor+radio;
System.out.println("total de compra"+compra);
}
}
run:
total de compra
150
300
total de compra450.0
BUILD SUCCESSFUL (total time:8 seconds)
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) 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)
6) package problema.secuenc.pkg5;
importjava.io.*;
publicclassProblemaSecuenc5{
publicstaticvoidmain(String[] args)throwsIOException{
intmonto,descuento;
floattotal;
BufferedReaderin=new BufferedReader(newInputStreamReader(System.in));
System.out.println("total descuento");
monto=Integer.parseInt(in.readLine());
descuento=Integer.parseInt(in.readLine());
total=monto-descuento;
System.out.println("total descuento"+total);
}
}
run:
total descuento
600
300
total descuento300.0
BUILD SUCCESSFUL (total time: 8 seconds)
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
8) package problema.secuenc.pkg3;
importjava.io.*;
publicclassProblemaSecuenc3{
publicstaticvoidmain(String[] args) throwsIOException{
intp,a,n;
floatpan;
BufferedReaderin=new BufferedReader(newInputStreamReader( System.in));
System.out.println("ingresep,a,n");
p=Integer.parseInt(in.readLine());
a=Integer.parseInt(in.readLine());
n=Integer.parseInt(in.readLine());
pan=p+a+n;
System.out.println("palabra"+pan);
}
}
run:
ingrese p,a,n
5
7
8
palabra20.0
BUILD SUCCESSFUL (total time:4 seconds)
9) package problema.secuen.pkg2;
importjava.io.*;
publicclassProblemaSecuen2{
publicstaticvoidmain(String[] args)throwsIOException{
intj,k;
floatm;
BufferedReaderin=newBufferedReader(new InputStreamReader(System.in));
System.out.println("si j esmayora k");
j=Integer.parseInt(in.readLine());
k=Integer.parseInt(in.readLine());
m=k;
if (j>k);
System.out.println("esmayor"+m);
}
}
run:
si j es mayora k
4
8
esmayor8.0
BUILD SUCCESSFUL (total time:3 seconds)
10) package problema.secuen.pkg1;
importjava.io.*;
publicclassProblemaSecuen1{
publicstaticvoidmain(String[] args)throwsIOException{
int s,o,l;
floatsol;
BufferedReaderin=newBufferedReader(new InputStreamReader(System.in));
System.out.println("ingresas,o,l");
s=Integer.parseInt(in.readLine());
o=Integer.parseInt(in.readLine());
l=Integer.parseInt(in.readLine());
sol=s+o+l;
System.out.println("sol"+sol);
}
}
run:
ingresas,o,l
500
350
400
sol1250.0
BUILD SUCCESSFUL (total time:11 seconds)

More Related Content

What's hot

Baocao ltjava
Baocao ltjavaBaocao ltjava
Baocao ltjava
Tnt Ttđ
 
EJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOSEJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOS
Darwin Durand
 
数式を構文解析した話
数式を構文解析した話数式を構文解析した話
数式を構文解析した話
y1r96 Ueno
 

What's hot (16)

Тененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговлеТененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговле
 
Baocao ltjava
Baocao ltjavaBaocao ltjava
Baocao ltjava
 
Danna y felix 10°
Danna y felix 10°Danna y felix 10°
Danna y felix 10°
 
ECMA2015 INSIDE
ECMA2015 INSIDEECMA2015 INSIDE
ECMA2015 INSIDE
 
JUG.ua 20170225 - Java bytecode instrumentation
JUG.ua 20170225 - Java bytecode instrumentationJUG.ua 20170225 - Java bytecode instrumentation
JUG.ua 20170225 - Java bytecode instrumentation
 
Proyecto Final Android-SQLite
Proyecto Final Android-SQLiteProyecto Final Android-SQLite
Proyecto Final Android-SQLite
 
JavaScript Assíncrono
JavaScript AssíncronoJavaScript Assíncrono
JavaScript Assíncrono
 
OpenResty/Lua 70+ Advanced Programming Skills and Optimization tips
OpenResty/Lua 70+ Advanced Programming Skills and Optimization tipsOpenResty/Lua 70+ Advanced Programming Skills and Optimization tips
OpenResty/Lua 70+ Advanced Programming Skills and Optimization tips
 
EJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOSEJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOS
 
Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016
Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016
Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016
 
Writeup ctf online idsecconf 2017
Writeup ctf online idsecconf 2017Writeup ctf online idsecconf 2017
Writeup ctf online idsecconf 2017
 
Sockets java
Sockets javaSockets java
Sockets java
 
Ejb 3.0 Glassfish 2.X Netbeans 6.X
Ejb 3.0 Glassfish 2.X Netbeans 6.XEjb 3.0 Glassfish 2.X Netbeans 6.X
Ejb 3.0 Glassfish 2.X Netbeans 6.X
 
Ejerc3 141204195452-conversion-gate01
Ejerc3 141204195452-conversion-gate01Ejerc3 141204195452-conversion-gate01
Ejerc3 141204195452-conversion-gate01
 
数式を構文解析した話
数式を構文解析した話数式を構文解析した話
数式を構文解析した話
 
Saints Row on the Go - Bringing Saints Row The Third to the Nintendo Switch
Saints Row on the Go - Bringing Saints Row The Third to the Nintendo SwitchSaints Row on the Go - Bringing Saints Row The Third to the Nintendo Switch
Saints Row on the Go - Bringing Saints Row The Third to the Nintendo Switch
 

Viewers also liked (8)

Be confident
Be confidentBe confident
Be confident
 
Sistema digestório exame fisico
Sistema digestório   exame fisicoSistema digestório   exame fisico
Sistema digestório exame fisico
 
Tiểu luận - Lớp bồi dưỡng cán bộ quản lý phòng, khoa, bộ môn
Tiểu luận - Lớp bồi dưỡng cán bộ quản lý phòng, khoa, bộ mônTiểu luận - Lớp bồi dưỡng cán bộ quản lý phòng, khoa, bộ môn
Tiểu luận - Lớp bồi dưỡng cán bộ quản lý phòng, khoa, bộ môn
 
Dia de los muertos altars
Dia de los muertos altarsDia de los muertos altars
Dia de los muertos altars
 
3 Essential Parts in Powerpoint
3 Essential Parts in Powerpoint3 Essential Parts in Powerpoint
3 Essential Parts in Powerpoint
 
150408081345152326 tb-sgd-t-3
150408081345152326 tb-sgd-t-3150408081345152326 tb-sgd-t-3
150408081345152326 tb-sgd-t-3
 
Scan 20150409 080510
Scan 20150409 080510Scan 20150409 080510
Scan 20150409 080510
 
Tattoo Art lesson
Tattoo Art lessonTattoo Art lesson
Tattoo Art lesson
 

ALGORITMO SECUENCIAL (Sistemas Contables)