SlideShare una empresa de Scribd logo
1 de 3
/*
* LABORATORIO No.
* INTEGRANTES DEL GRUPO:
* CODIGO DE LOS INTEGRANTES:
* FECHA DE REALIZACIÓN:
* PROFESOR DEL LABORATORIO:
* SALA DE COMPUTO No.
* DESCRIPCION DE LA CLASE:
*/
import javax.swing.*;
class Almacen
{
//Definición de atributos
private String vendedor1, vendedor2, vendedor3;
private double ventas1, ventas2, ventas3;
//Definición de metodos
public void leerDatos()
{
String entrada;
vendedor1=JOptionPane.showInputDialog("Digite nombre del vendedor
1: ");
entrada=JOptionPane.showInputDialog("Digite el total de ventas del
vendedor 1: ");
ventas1=Double.parseDouble(entrada);
vendedor2=JOptionPane.showInputDialog("Digite nombre del vendedor
2: ");
entrada=JOptionPane.showInputDialog("Digite el total de ventas del
vendedor 2: ");
ventas2=Double.parseDouble(entrada);
vendedor3=JOptionPane.showInputDialog("Digite nombre del vendedor
3: ");
entrada=JOptionPane.showInputDialog("Digite el total de ventas del
vendedor 3: ");
ventas3=Double.parseDouble(entrada);
}
public void calcularOrden()
{
String salida="El orden de los vendedores es: n";
if(ventas1>ventas2)
{
if(ventas1>ventas3)
{
if (ventas2>ventas3)
{
salida+=vendedor1 + " " + ventas1 + "n";
salida+=vendedor2 + " " + ventas2 + "n";
salida+=vendedor3 + " " + ventas3 + "n";
}
else
{
salida+=vendedor1 + " " + ventas1 + "n";
salida+=vendedor3 + " " + ventas3 + "n";
salida+=vendedor2 + " " + ventas2 + "n";
}
}
else
{
salida+=vendedor3 + " " + ventas3 + "n";
salida+=vendedor1 + " " + ventas1 + "n";
salida+=vendedor2 + " " + ventas2 + "n";
}
}
else
{
if(ventas2>ventas3)
{
if(ventas1>ventas3)
{
salida+=vendedor2 + " " + ventas2 + "n";
salida+=vendedor1 + " " + ventas1 + "n";
salida+=vendedor3 + " " + ventas3 + "n";
}
else
{
salida+=vendedor2 + " " + ventas2 + "n";
salida+=vendedor3 + " " + ventas3 + "n";
salida+=vendedor1 + " " + ventas1 + "n";
}
}
else
{
salida+=vendedor3 + " " + ventas3 + "n";
salida+=vendedor2 + " " + ventas2 + "n";
salida+=vendedor1 + " " + ventas1 + "n";
}
}
JOptionPane.showMessageDialog(null,salida);
}
}
/*
DESCRIPCION DE LA CLASE:
*/
public class UsaAlmacen
{
public static void main(String a[])
{ //Método principal
Almacen superPizza=new Almacen(); //Creación del objeto de la clase
Proveedor
//Utilización de los métodos del objeto creado
superPizza.leerDatos();
superPizza.calcularOrden();
System.exit(0);
}
}

Más contenido relacionado

La actualidad más candente (11)

Prepared statement
Prepared statementPrepared statement
Prepared statement
 
Introducción a TDD y PHPUnit
Introducción a TDD y PHPUnitIntroducción a TDD y PHPUnit
Introducción a TDD y PHPUnit
 
New 3
New  3New  3
New 3
 
PHPVigo #16 - Lightning filter input
PHPVigo #16 - Lightning filter inputPHPVigo #16 - Lightning filter input
PHPVigo #16 - Lightning filter input
 
Metodos en java
Metodos en javaMetodos en java
Metodos en java
 
1 1 5 Objetos Excepcion
1 1 5 Objetos Excepcion1 1 5 Objetos Excepcion
1 1 5 Objetos Excepcion
 
Novedades de PHP 7.*
Novedades de PHP 7.*Novedades de PHP 7.*
Novedades de PHP 7.*
 
2.9 variables
2.9 variables2.9 variables
2.9 variables
 
Excepciones
ExcepcionesExcepciones
Excepciones
 
Hack (Lenguaje de Programacion)
Hack (Lenguaje de Programacion)Hack (Lenguaje de Programacion)
Hack (Lenguaje de Programacion)
 
Alejandra soscue java
Alejandra soscue javaAlejandra soscue java
Alejandra soscue java
 

Destacado

CCS_Capabilities_Presentation_4-21-2016
CCS_Capabilities_Presentation_4-21-2016CCS_Capabilities_Presentation_4-21-2016
CCS_Capabilities_Presentation_4-21-2016
Lauren McCormack
 

Destacado (13)

Los deportes
Los deportesLos deportes
Los deportes
 
Women who you are thankful
Women who you are thankfulWomen who you are thankful
Women who you are thankful
 
CCS_Capabilities_Presentation_4-21-2016
CCS_Capabilities_Presentation_4-21-2016CCS_Capabilities_Presentation_4-21-2016
CCS_Capabilities_Presentation_4-21-2016
 
6th meeting of Effective Teaching of Mathematics Erasmus+ Project - Romanian ...
6th meeting of Effective Teaching of Mathematics Erasmus+ Project - Romanian ...6th meeting of Effective Teaching of Mathematics Erasmus+ Project - Romanian ...
6th meeting of Effective Teaching of Mathematics Erasmus+ Project - Romanian ...
 
Wroclaw Meeting Effective Teaching of Mathematics
Wroclaw Meeting Effective Teaching of MathematicsWroclaw Meeting Effective Teaching of Mathematics
Wroclaw Meeting Effective Teaching of Mathematics
 
Jorge luis gaitan_actividad1_2_mapac
Jorge luis gaitan_actividad1_2_mapacJorge luis gaitan_actividad1_2_mapac
Jorge luis gaitan_actividad1_2_mapac
 
58170038
5817003858170038
58170038
 
Power supply designed by amani james
Power supply  designed by amani  jamesPower supply  designed by amani  james
Power supply designed by amani james
 
Mayeutica dialectica
Mayeutica dialecticaMayeutica dialectica
Mayeutica dialectica
 
Stredná Ázia
Stredná ÁziaStredná Ázia
Stredná Ázia
 
Južná Ázia
Južná ÁziaJužná Ázia
Južná Ázia
 
Content Organization
Content OrganizationContent Organization
Content Organization
 
Matlab 58170042 (1)
Matlab 58170042 (1)Matlab 58170042 (1)
Matlab 58170042 (1)
 

Último

Topografía cuadro de construcción ing.civil
Topografía cuadro de construcción ing.civilTopografía cuadro de construcción ing.civil
Topografía cuadro de construcción ing.civil
meloamerica93
 
GRUPO 1.pptx problemas oportunidades objetivos
GRUPO 1.pptx problemas oportunidades objetivosGRUPO 1.pptx problemas oportunidades objetivos
GRUPO 1.pptx problemas oportunidades objetivos
CristianGmez22034
 
PLANTILLA UNAD JJAJJJJJWRBJHGURGERRTERTRTRY
PLANTILLA UNAD JJAJJJJJWRBJHGURGERRTERTRTRYPLANTILLA UNAD JJAJJJJJWRBJHGURGERRTERTRTRY
PLANTILLA UNAD JJAJJJJJWRBJHGURGERRTERTRTRY
karendaza9506
 

Último (20)

Planificación del mes de afrovenezolanidad2024.doc
Planificación del mes de afrovenezolanidad2024.docPlanificación del mes de afrovenezolanidad2024.doc
Planificación del mes de afrovenezolanidad2024.doc
 
cabildo abierto forma de participación ciudadana
cabildo abierto forma de participación ciudadanacabildo abierto forma de participación ciudadana
cabildo abierto forma de participación ciudadana
 
Afiche de arquitectura manierista Paola Perez
Afiche de arquitectura manierista Paola PerezAfiche de arquitectura manierista Paola Perez
Afiche de arquitectura manierista Paola Perez
 
Jesus Diaz afiche Manierismo .pdf arquitectura
Jesus Diaz afiche Manierismo .pdf arquitecturaJesus Diaz afiche Manierismo .pdf arquitectura
Jesus Diaz afiche Manierismo .pdf arquitectura
 
Arte textil: Tejidos artesanos en la frontera hispano-lusa
Arte textil: Tejidos artesanos en la frontera hispano-lusaArte textil: Tejidos artesanos en la frontera hispano-lusa
Arte textil: Tejidos artesanos en la frontera hispano-lusa
 
Topografía cuadro de construcción ing.civil
Topografía cuadro de construcción ing.civilTopografía cuadro de construcción ing.civil
Topografía cuadro de construcción ing.civil
 
Espacios únicos creados por nuestros clientes
Espacios únicos creados por nuestros clientesEspacios únicos creados por nuestros clientes
Espacios únicos creados por nuestros clientes
 
POESÍA ERÓTICA DEL SIGLO XVIII - SERIA Y CARNAL
POESÍA ERÓTICA DEL SIGLO XVIII - SERIA Y CARNALPOESÍA ERÓTICA DEL SIGLO XVIII - SERIA Y CARNAL
POESÍA ERÓTICA DEL SIGLO XVIII - SERIA Y CARNAL
 
plantilla-de-messi-1.pdf es muy especial
plantilla-de-messi-1.pdf es muy especialplantilla-de-messi-1.pdf es muy especial
plantilla-de-messi-1.pdf es muy especial
 
Torre 222 sobre instalaciones de este mismo edificio
Torre 222 sobre instalaciones de este mismo edificioTorre 222 sobre instalaciones de este mismo edificio
Torre 222 sobre instalaciones de este mismo edificio
 
GROPUIS Y WRIGHT DIPOSITIVA ARQUITECTURA DISEÑO MODERNIDAD
GROPUIS Y WRIGHT DIPOSITIVA ARQUITECTURA DISEÑO MODERNIDADGROPUIS Y WRIGHT DIPOSITIVA ARQUITECTURA DISEÑO MODERNIDAD
GROPUIS Y WRIGHT DIPOSITIVA ARQUITECTURA DISEÑO MODERNIDAD
 
guia de talles de camitas cucciolos 2024.pdf
guia de talles de camitas cucciolos 2024.pdfguia de talles de camitas cucciolos 2024.pdf
guia de talles de camitas cucciolos 2024.pdf
 
GRUPO 1.pptx problemas oportunidades objetivos
GRUPO 1.pptx problemas oportunidades objetivosGRUPO 1.pptx problemas oportunidades objetivos
GRUPO 1.pptx problemas oportunidades objetivos
 
INICIOS DEL MOVIMIENTO MODERNO 1900-1930.pdf
INICIOS DEL MOVIMIENTO MODERNO 1900-1930.pdfINICIOS DEL MOVIMIENTO MODERNO 1900-1930.pdf
INICIOS DEL MOVIMIENTO MODERNO 1900-1930.pdf
 
PLANTILLA UNAD JJAJJJJJWRBJHGURGERRTERTRTRY
PLANTILLA UNAD JJAJJJJJWRBJHGURGERRTERTRTRYPLANTILLA UNAD JJAJJJJJWRBJHGURGERRTERTRTRY
PLANTILLA UNAD JJAJJJJJWRBJHGURGERRTERTRTRY
 
Geometrías de la imaginación: Diseño e iconografía de Querétaro
Geometrías de la imaginación: Diseño e iconografía de QuerétaroGeometrías de la imaginación: Diseño e iconografía de Querétaro
Geometrías de la imaginación: Diseño e iconografía de Querétaro
 
CLASE 2 PSICOTERAPIA COGNITIVO CONDUCTUAL.pdf
CLASE 2 PSICOTERAPIA COGNITIVO CONDUCTUAL.pdfCLASE 2 PSICOTERAPIA COGNITIVO CONDUCTUAL.pdf
CLASE 2 PSICOTERAPIA COGNITIVO CONDUCTUAL.pdf
 
SESION 05 MOBILIARIO Y EQUIPAMIENTO.pptx
SESION 05 MOBILIARIO Y EQUIPAMIENTO.pptxSESION 05 MOBILIARIO Y EQUIPAMIENTO.pptx
SESION 05 MOBILIARIO Y EQUIPAMIENTO.pptx
 
Portafolio Santiago Agudelo Duran 2024 -30
Portafolio Santiago Agudelo Duran 2024 -30Portafolio Santiago Agudelo Duran 2024 -30
Portafolio Santiago Agudelo Duran 2024 -30
 
ARQUITECTURA ESCOLAR PÚBLICA COMO PATRIMONIO MODERNO EN CHILE
ARQUITECTURA ESCOLAR PÚBLICA COMO PATRIMONIO MODERNO EN CHILEARQUITECTURA ESCOLAR PÚBLICA COMO PATRIMONIO MODERNO EN CHILE
ARQUITECTURA ESCOLAR PÚBLICA COMO PATRIMONIO MODERNO EN CHILE
 

Usaalmacen

  • 1. /* * LABORATORIO No. * INTEGRANTES DEL GRUPO: * CODIGO DE LOS INTEGRANTES: * FECHA DE REALIZACIÓN: * PROFESOR DEL LABORATORIO: * SALA DE COMPUTO No. * DESCRIPCION DE LA CLASE: */ import javax.swing.*; class Almacen { //Definición de atributos private String vendedor1, vendedor2, vendedor3; private double ventas1, ventas2, ventas3; //Definición de metodos public void leerDatos() { String entrada; vendedor1=JOptionPane.showInputDialog("Digite nombre del vendedor 1: "); entrada=JOptionPane.showInputDialog("Digite el total de ventas del vendedor 1: "); ventas1=Double.parseDouble(entrada); vendedor2=JOptionPane.showInputDialog("Digite nombre del vendedor 2: "); entrada=JOptionPane.showInputDialog("Digite el total de ventas del vendedor 2: "); ventas2=Double.parseDouble(entrada); vendedor3=JOptionPane.showInputDialog("Digite nombre del vendedor 3: "); entrada=JOptionPane.showInputDialog("Digite el total de ventas del vendedor 3: "); ventas3=Double.parseDouble(entrada); } public void calcularOrden() { String salida="El orden de los vendedores es: n"; if(ventas1>ventas2) { if(ventas1>ventas3)
  • 2. { if (ventas2>ventas3) { salida+=vendedor1 + " " + ventas1 + "n"; salida+=vendedor2 + " " + ventas2 + "n"; salida+=vendedor3 + " " + ventas3 + "n"; } else { salida+=vendedor1 + " " + ventas1 + "n"; salida+=vendedor3 + " " + ventas3 + "n"; salida+=vendedor2 + " " + ventas2 + "n"; } } else { salida+=vendedor3 + " " + ventas3 + "n"; salida+=vendedor1 + " " + ventas1 + "n"; salida+=vendedor2 + " " + ventas2 + "n"; } } else { if(ventas2>ventas3) { if(ventas1>ventas3) { salida+=vendedor2 + " " + ventas2 + "n"; salida+=vendedor1 + " " + ventas1 + "n"; salida+=vendedor3 + " " + ventas3 + "n"; } else { salida+=vendedor2 + " " + ventas2 + "n"; salida+=vendedor3 + " " + ventas3 + "n"; salida+=vendedor1 + " " + ventas1 + "n"; } } else { salida+=vendedor3 + " " + ventas3 + "n"; salida+=vendedor2 + " " + ventas2 + "n"; salida+=vendedor1 + " " + ventas1 + "n"; } } JOptionPane.showMessageDialog(null,salida); } } /* DESCRIPCION DE LA CLASE: */
  • 3. public class UsaAlmacen { public static void main(String a[]) { //Método principal Almacen superPizza=new Almacen(); //Creación del objeto de la clase Proveedor //Utilización de los métodos del objeto creado superPizza.leerDatos(); superPizza.calcularOrden(); System.exit(0); } }