SlideShare una empresa de Scribd logo
1 de 8
Multiplicación de
dos números
Cetis109
TlLez Mendo Tania
4Am
Programación
Maestra: Margarita Romero Alvarado
• INVESTIGACION DE LA MULTIPLICACION DE DOS
NUMEROS
• Para pedir los datos, tenemos que abrir un InputStream a la
consola, el cual leerá lo que se vaya insertando. Nos
apoyaremos en un BufferedReader para realizar la lectura de
una forma sencilla.
BufferedReader br;
• br = new BufferedReader(new
InputStreamReader(System.in));
• La lectura la haremos apoyándonos en el método .readLine() que
lee el texto introducido, hasta encontrarse con un retorno de carro.
Este método nos devolverá un String con el texto leído.
• Si bien, lo que nosotros necesitamos es un entero. Así que
tendremos que transformar la cadena de texto en un int. Para ello
nos apoyamos en la clase Integer y el método .parseInt, el cual
recibe una cadena y devuelve un entero.
•
• numero1 = Integer.parseInt(br.readLine());
• numero2 = Integer.parseInt(br.readLine());
•
• Realizamos la operación por los dos números. Hay que tener
cuidado ya que el método .readLine puede lanzar la excepción
IOException. Es por ello que tendremos que meterlo todo en un
try-catch.
•
• try{
• System.out.println("Introduce el primer número:");
• numero1 = Integer.parseInt(br.readLine());
• System.out.println("Introduce el segundo número:");
• numero2 = Integer.parseInt(br.readLine());
• } catch (IOException ioe){
• ioe.printStackTrace();
• }
•
• Ahora solo nos quedará el multiplicar los números y mostrar el
resultado por pantalla.
•
• resultado = numero1*numero2;
• System.out.println("La multiplicación es " + numero1 + " x " +
numero2 + " = " + resultado);
•
•VIDEO:
•https://www.youtube.com/watc
h?v=Abk1DL_liTE

Más contenido relacionado

Destacado

Przemysł 4.0
Przemysł 4.0Przemysł 4.0
Przemysł 4.0BPSC
 
Itinerario Semana Santa 2.010
Itinerario Semana Santa 2.010Itinerario Semana Santa 2.010
Itinerario Semana Santa 2.010Ceip Blas Infante
 
Data centers
Data centersData centers
Data centerstejaswi25
 
7 Tips to Optimize Data Center Performance
7 Tips to Optimize Data Center Performance7 Tips to Optimize Data Center Performance
7 Tips to Optimize Data Center PerformanceServerCentral
 
Internet of Things, Connected Infrastructure & The Modern Supply Chain
Internet of Things, Connected Infrastructure & The Modern Supply ChainInternet of Things, Connected Infrastructure & The Modern Supply Chain
Internet of Things, Connected Infrastructure & The Modern Supply ChainJeff Risley
 
A report about marine diesel engines
A report about marine diesel enginesA report about marine diesel engines
A report about marine diesel enginesarmanimams
 
Hydraulic Machines Fluid coupling, Fluid torque converter
Hydraulic Machines    Fluid coupling, Fluid torque converterHydraulic Machines    Fluid coupling, Fluid torque converter
Hydraulic Machines Fluid coupling, Fluid torque converterUniversity of Windsor
 
Structure And Function Of Haemoglobin
Structure And Function Of  HaemoglobinStructure And Function Of  Haemoglobin
Structure And Function Of HaemoglobinPragmatic Learning
 

Destacado (15)

Investigacion 2
Investigacion 2Investigacion 2
Investigacion 2
 
Practica 5 (1)
Practica 5 (1)Practica 5 (1)
Practica 5 (1)
 
Przemysł 4.0
Przemysł 4.0Przemysł 4.0
Przemysł 4.0
 
DISFRUTALO
DISFRUTALODISFRUTALO
DISFRUTALO
 
Itinerario Semana Santa 2.010
Itinerario Semana Santa 2.010Itinerario Semana Santa 2.010
Itinerario Semana Santa 2.010
 
As 1902-metal-seated-ball-valve-en
As 1902-metal-seated-ball-valve-enAs 1902-metal-seated-ball-valve-en
As 1902-metal-seated-ball-valve-en
 
Data centers
Data centersData centers
Data centers
 
7 Tips to Optimize Data Center Performance
7 Tips to Optimize Data Center Performance7 Tips to Optimize Data Center Performance
7 Tips to Optimize Data Center Performance
 
Internet of Things, Connected Infrastructure & The Modern Supply Chain
Internet of Things, Connected Infrastructure & The Modern Supply ChainInternet of Things, Connected Infrastructure & The Modern Supply Chain
Internet of Things, Connected Infrastructure & The Modern Supply Chain
 
Compact Clean Steam Generator
Compact Clean Steam GeneratorCompact Clean Steam Generator
Compact Clean Steam Generator
 
A report about marine diesel engines
A report about marine diesel enginesA report about marine diesel engines
A report about marine diesel engines
 
Hydraulic Machines Fluid coupling, Fluid torque converter
Hydraulic Machines    Fluid coupling, Fluid torque converterHydraulic Machines    Fluid coupling, Fluid torque converter
Hydraulic Machines Fluid coupling, Fluid torque converter
 
Catabolism of heme
Catabolism of hemeCatabolism of heme
Catabolism of heme
 
Structure And Function Of Haemoglobin
Structure And Function Of  HaemoglobinStructure And Function Of  Haemoglobin
Structure And Function Of Haemoglobin
 
Scanner
ScannerScanner
Scanner
 

Más de Tania Tellez

Más de Tania Tellez (20)

Equipo 4(2)
Equipo 4(2)Equipo 4(2)
Equipo 4(2)
 
Dulzura triptico
Dulzura tripticoDulzura triptico
Dulzura triptico
 
Dulzura1(2)(2)
Dulzura1(2)(2)Dulzura1(2)(2)
Dulzura1(2)(2)
 
Practica 8(2)
Practica 8(2)Practica 8(2)
Practica 8(2)
 
Practica 7
Practica 7Practica 7
Practica 7
 
Practica 4 t(2)
Practica 4 t(2)Practica 4 t(2)
Practica 4 t(2)
 
Presentacion tania123(2)
Presentacion tania123(2)Presentacion tania123(2)
Presentacion tania123(2)
 
Practica 3
Practica 3Practica 3
Practica 3
 
Practica tania
Practica taniaPractica tania
Practica tania
 
Celular virtual
Celular virtualCelular virtual
Celular virtual
 
Tutorial eclipse3
Tutorial eclipse3Tutorial eclipse3
Tutorial eclipse3
 
Tutorial eclipse2
Tutorial eclipse2Tutorial eclipse2
Tutorial eclipse2
 
Tutorial eclipse1
Tutorial eclipse1Tutorial eclipse1
Tutorial eclipse1
 
tutorial de eclipse
tutorial de eclipsetutorial de eclipse
tutorial de eclipse
 
Investigacion 1
Investigacion 1Investigacion 1
Investigacion 1
 
Practicas 26 27_28_y_29_tania
Practicas 26 27_28_y_29_taniaPracticas 26 27_28_y_29_tania
Practicas 26 27_28_y_29_tania
 
Practicas 21 22_23_24_tania
Practicas 21 22_23_24_taniaPracticas 21 22_23_24_tania
Practicas 21 22_23_24_tania
 
Presentacion programas tania
Presentacion programas taniaPresentacion programas tania
Presentacion programas tania
 
Cartel
CartelCartel
Cartel
 
Presentaciontania(2)
Presentaciontania(2)Presentaciontania(2)
Presentaciontania(2)
 

Último

BREEAM ES Urbanismo como herramienta para un planeamiento sostenible - Miguel...
BREEAM ES Urbanismo como herramienta para un planeamiento sostenible - Miguel...BREEAM ES Urbanismo como herramienta para un planeamiento sostenible - Miguel...
BREEAM ES Urbanismo como herramienta para un planeamiento sostenible - Miguel...ITeC Instituto Tecnología Construcción
 
Caso de éxito de Hervian con el ERP Sage 200
Caso de éxito de Hervian con el ERP Sage 200Caso de éxito de Hervian con el ERP Sage 200
Caso de éxito de Hervian con el ERP Sage 200Opentix
 
PARTES DEL TECLADO Y SUS FUNCIONES - EJEMPLO
PARTES DEL TECLADO Y SUS FUNCIONES - EJEMPLOPARTES DEL TECLADO Y SUS FUNCIONES - EJEMPLO
PARTES DEL TECLADO Y SUS FUNCIONES - EJEMPLOSelenaCoronadoHuaman
 
Manual de Usuario APPs_AppInventor-2023.pdf
Manual de Usuario APPs_AppInventor-2023.pdfManual de Usuario APPs_AppInventor-2023.pdf
Manual de Usuario APPs_AppInventor-2023.pdfmasogeis
 
Introducción a Funciones LENGUAJE DART FLUTTER
Introducción a Funciones LENGUAJE DART FLUTTERIntroducción a Funciones LENGUAJE DART FLUTTER
Introducción a Funciones LENGUAJE DART FLUTTEREMMAFLORESCARMONA
 
Segmentacion Segmantica_Modelos UNET and DEEPLABV3
Segmentacion Segmantica_Modelos UNET and DEEPLABV3Segmentacion Segmantica_Modelos UNET and DEEPLABV3
Segmentacion Segmantica_Modelos UNET and DEEPLABV3AlexysCaytanoMelndez1
 
Unidad_3_T1_AutomatasFinitos presentacion
Unidad_3_T1_AutomatasFinitos presentacionUnidad_3_T1_AutomatasFinitos presentacion
Unidad_3_T1_AutomatasFinitos presentacionarmando_cardenas
 

Último (7)

BREEAM ES Urbanismo como herramienta para un planeamiento sostenible - Miguel...
BREEAM ES Urbanismo como herramienta para un planeamiento sostenible - Miguel...BREEAM ES Urbanismo como herramienta para un planeamiento sostenible - Miguel...
BREEAM ES Urbanismo como herramienta para un planeamiento sostenible - Miguel...
 
Caso de éxito de Hervian con el ERP Sage 200
Caso de éxito de Hervian con el ERP Sage 200Caso de éxito de Hervian con el ERP Sage 200
Caso de éxito de Hervian con el ERP Sage 200
 
PARTES DEL TECLADO Y SUS FUNCIONES - EJEMPLO
PARTES DEL TECLADO Y SUS FUNCIONES - EJEMPLOPARTES DEL TECLADO Y SUS FUNCIONES - EJEMPLO
PARTES DEL TECLADO Y SUS FUNCIONES - EJEMPLO
 
Manual de Usuario APPs_AppInventor-2023.pdf
Manual de Usuario APPs_AppInventor-2023.pdfManual de Usuario APPs_AppInventor-2023.pdf
Manual de Usuario APPs_AppInventor-2023.pdf
 
Introducción a Funciones LENGUAJE DART FLUTTER
Introducción a Funciones LENGUAJE DART FLUTTERIntroducción a Funciones LENGUAJE DART FLUTTER
Introducción a Funciones LENGUAJE DART FLUTTER
 
Segmentacion Segmantica_Modelos UNET and DEEPLABV3
Segmentacion Segmantica_Modelos UNET and DEEPLABV3Segmentacion Segmantica_Modelos UNET and DEEPLABV3
Segmentacion Segmantica_Modelos UNET and DEEPLABV3
 
Unidad_3_T1_AutomatasFinitos presentacion
Unidad_3_T1_AutomatasFinitos presentacionUnidad_3_T1_AutomatasFinitos presentacion
Unidad_3_T1_AutomatasFinitos presentacion
 

Multiplicación números

  • 1. Multiplicación de dos números Cetis109 TlLez Mendo Tania 4Am Programación Maestra: Margarita Romero Alvarado
  • 2.
  • 3.
  • 4. • INVESTIGACION DE LA MULTIPLICACION DE DOS NUMEROS • Para pedir los datos, tenemos que abrir un InputStream a la consola, el cual leerá lo que se vaya insertando. Nos apoyaremos en un BufferedReader para realizar la lectura de una forma sencilla. BufferedReader br; • br = new BufferedReader(new InputStreamReader(System.in));
  • 5. • La lectura la haremos apoyándonos en el método .readLine() que lee el texto introducido, hasta encontrarse con un retorno de carro. Este método nos devolverá un String con el texto leído. • Si bien, lo que nosotros necesitamos es un entero. Así que tendremos que transformar la cadena de texto en un int. Para ello nos apoyamos en la clase Integer y el método .parseInt, el cual recibe una cadena y devuelve un entero. • • numero1 = Integer.parseInt(br.readLine()); • numero2 = Integer.parseInt(br.readLine()); •
  • 6. • Realizamos la operación por los dos números. Hay que tener cuidado ya que el método .readLine puede lanzar la excepción IOException. Es por ello que tendremos que meterlo todo en un try-catch. • • try{ • System.out.println("Introduce el primer número:"); • numero1 = Integer.parseInt(br.readLine()); • System.out.println("Introduce el segundo número:"); • numero2 = Integer.parseInt(br.readLine()); • } catch (IOException ioe){ • ioe.printStackTrace(); • } •
  • 7. • Ahora solo nos quedará el multiplicar los números y mostrar el resultado por pantalla. • • resultado = numero1*numero2; • System.out.println("La multiplicación es " + numero1 + " x " + numero2 + " = " + resultado); •