SlideShare a Scribd company logo
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

PDF
Java AWT Calculadora
PPTX
Алексей Кутумов, C++ без исключений, часть 3
PDF
Kruskal algorithm
DOCX
Ejercicios condicionales
DOCX
Evaluacion
ODP
C++14 reflections
PDF
Java Thread Cronometro
ODP
Антон Полухин. C++17
Java AWT Calculadora
Алексей Кутумов, C++ без исключений, часть 3
Kruskal algorithm
Ejercicios condicionales
Evaluacion
C++14 reflections
Java Thread Cronometro
Антон Полухин. C++17

What's hot (16)

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

Viewers also liked (11)

PDF
Teknik SEO Blackhat
PDF
Memoria Profesional Guillermo Barthel Marzo 2010
PDF
PDF
Informe de gestión dae 2010
PPTX
Interactive upload
PDF
Cara Hack XL
PPTX
PDF
Cara Hack 3
PDF
Taller sobre convenios de colaboración universidad-empresa
PPTX
κόροιβος
PDF
Guia didactica INTOCABLE
Teknik SEO Blackhat
Memoria Profesional Guillermo Barthel Marzo 2010
Informe de gestión dae 2010
Interactive upload
Cara Hack XL
Cara Hack 3
Taller sobre convenios de colaboración universidad-empresa
κόροιβος
Guia didactica INTOCABLE
Ad

Algoritmo secuencial