SlideShare una empresa de Scribd logo
1 de 9
OPERACIONES ARITMETICAS
CETIS 109
YAMARY SÁNCHEZ RAMOS
EMILIANO GONZÁLEZ MÉNDEZ
CARLOS SAMUEL GUTIÉRREZ RODRÍGUEZ
JUAN ALBERTO DE JESÚS GARCÍA VÁZQUEZ
4° DM PROGRAMACION
MARGARITA ROMERO ALVARADO
PASO 1:
• Primero empezamos un nuevo
Android Aplication Proyect y
ponemos el nombre que
gusten.
PASO 2:
Insertamos un relative layout
Después radio group y
automáticamente aparecerán 3
radio button, borramos 1
porque solo ocuparemos 2
después agregamos un botón
que se llame CALCULAR,
después agregamos tres
textview
Se llamaran DAME UN
NUMERO, DAME OTRO
NUMERO y resultado, y por su
puesto 2 textfields debajo de
los 2 primeros textview.
PASO 3:
• Debemos ir a Package
Explorer para poder abrir
MainActivity en el cual se
encuentra nuestro código
package com.example.programa5;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.RadioButton;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle
savedInstanceState) {
super.onCreate(savedInstan
ceState);
setContentView(R.layout.acti
vity_main);
}
@Override
public boolean
onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds
items to the action bar if it is present.
getMenuInflater().inflate(R.m
enu.main, menu);
return true;
}
public void operar(View view) {
EditText
et1=(EditText)findViewById(R.id.et1);
EditText
et2=(EditText)findViewById(R.id.et2);
TextView
tv3=(TextView)findViewById(R.id.tv3);
RadioButton
radio0=(RadioButton)findViewById(R.id.radio0);
RadioButton
radio1=(RadioButton)findViewById(R.id.radio1);
int
nro1=Integer.parseInt(et1.getText().toString());
int
nro2=Integer.parseInt(et2.getText().toString());
if (radio0.isChecked()==true) {
int suma=nro1+nro2;
String resu=String.valueOf(suma);
tv3.setText(resu);
} else
if (radio1.isChecked()==true) {
int resta=nro1-nro2;
String resu=String.valueOf(resta);
tv3.setText(resu);
}
}
}
Así aparecerá el código.
PASO 5:
• Ahora guardamos todos los cambios
para poder hacer el siguiente paso
PASO 6:
• Por ultimo corremos el programa yendo
a la carpeta que esta en package
Explorer y le damos Run As y en nuestra
primera opción para poder abrir el
emulador y correr nuestra aplicación
para poder hacer las pruebas y LISTO!!
Terminamos.
CONCLUSIÓN:
• Existe un error en la acción del
botón que hay que prestarle
mucha acción porque ese
simple error puede perjudicar
todo el programa y no correrá y
se cerrara automáticamente.
Carlos Samuel Gutiérrez Rodríguez 4DM

Más contenido relacionado

Destacado

Tessellation power point (2)
Tessellation power point (2)Tessellation power point (2)
Tessellation power point (2)Alyson Sprague
 
Tessellations
TessellationsTessellations
Tessellationsjoebelnap
 
Unit 18 - Tessellations
Unit 18 - TessellationsUnit 18 - Tessellations
Unit 18 - Tessellationsiknowican
 
Tessellations 1
Tessellations 1Tessellations 1
Tessellations 1cisenberg2
 
Tessellation project
Tessellation projectTessellation project
Tessellation projectgregcross22
 
Combined Tesselation Project
Combined Tesselation ProjectCombined Tesselation Project
Combined Tesselation ProjectKatie Harvey
 
Tessellation
TessellationTessellation
TessellationBevster01
 
Exploring tessellations
Exploring tessellationsExploring tessellations
Exploring tessellationsrosamparo
 
Creating A Tessellation using Photoshop
Creating A Tessellation using PhotoshopCreating A Tessellation using Photoshop
Creating A Tessellation using Photoshopreederj
 
GDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
GDC 2014 - Deformable Snow Rendering in Batman: Arkham OriginsGDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
GDC 2014 - Deformable Snow Rendering in Batman: Arkham OriginsColin Barré-Brisebois
 
Tessellation ppt
Tessellation pptTessellation ppt
Tessellation pptmrsfrasure
 

Destacado (16)

FINAL PRES
FINAL PRESFINAL PRES
FINAL PRES
 
Tessellation power point (2)
Tessellation power point (2)Tessellation power point (2)
Tessellation power point (2)
 
Tessellations
TessellationsTessellations
Tessellations
 
Tesselations by ix e
Tesselations by ix eTesselations by ix e
Tesselations by ix e
 
Tessellation project
Tessellation projectTessellation project
Tessellation project
 
Unit 18 - Tessellations
Unit 18 - TessellationsUnit 18 - Tessellations
Unit 18 - Tessellations
 
Tessellations 1
Tessellations 1Tessellations 1
Tessellations 1
 
Tessellation project
Tessellation projectTessellation project
Tessellation project
 
Combined Tesselation Project
Combined Tesselation ProjectCombined Tesselation Project
Combined Tesselation Project
 
Tessellation
TessellationTessellation
Tessellation
 
Exploring tessellations
Exploring tessellationsExploring tessellations
Exploring tessellations
 
Escher
EscherEscher
Escher
 
Tessellations
TessellationsTessellations
Tessellations
 
Creating A Tessellation using Photoshop
Creating A Tessellation using PhotoshopCreating A Tessellation using Photoshop
Creating A Tessellation using Photoshop
 
GDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
GDC 2014 - Deformable Snow Rendering in Batman: Arkham OriginsGDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
GDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
 
Tessellation ppt
Tessellation pptTessellation ppt
Tessellation ppt
 

Similar a practica 1 (20)

Manual de aplicaciones moviles
Manual de aplicaciones moviles Manual de aplicaciones moviles
Manual de aplicaciones moviles
 
Manual de aplicaciones moviles
Manual de aplicaciones movilesManual de aplicaciones moviles
Manual de aplicaciones moviles
 
Manual de aplicaciones moviles
Manual de aplicaciones moviles Manual de aplicaciones moviles
Manual de aplicaciones moviles
 
Manual de aplicaciones moviles
Manual de aplicaciones moviles Manual de aplicaciones moviles
Manual de aplicaciones moviles
 
Programa6
Programa6Programa6
Programa6
 
Salazar alejandre cesar programa 3
Salazar alejandre cesar  programa 3Salazar alejandre cesar  programa 3
Salazar alejandre cesar programa 3
 
Programa 6
Programa 6Programa 6
Programa 6
 
Programa 6 gisela
Programa 6 giselaPrograma 6 gisela
Programa 6 gisela
 
Programa 6 gisela
Programa 6 giselaPrograma 6 gisela
Programa 6 gisela
 
Imperial math -_expo
Imperial math -_expoImperial math -_expo
Imperial math -_expo
 
Imperial math- Presentacion
Imperial math- PresentacionImperial math- Presentacion
Imperial math- Presentacion
 
programa 2
programa 2 programa 2
programa 2
 
Programa22
Programa22Programa22
Programa22
 
Programa22
Programa22Programa22
Programa22
 
Programa 2
Programa 2 Programa 2
Programa 2
 
Practica 8
Practica 8Practica 8
Practica 8
 
Tutorial Operaciones Aritmeticas Utilizaondo Spinner
Tutorial Operaciones Aritmeticas Utilizaondo SpinnerTutorial Operaciones Aritmeticas Utilizaondo Spinner
Tutorial Operaciones Aritmeticas Utilizaondo Spinner
 
Programa2
Programa2Programa2
Programa2
 
Programa2
Programa2Programa2
Programa2
 
Programa 2
Programa 2Programa 2
Programa 2
 

Más de Manuel Gutierrez (20)

practica8
practica8practica8
practica8
 
Practica7
Practica7Practica7
Practica7
 
Practica6
Practica6Practica6
Practica6
 
Practica5-Sueldo Final
Practica5-Sueldo FinalPractica5-Sueldo Final
Practica5-Sueldo Final
 
Suma,resta,multiplicacion
Suma,resta,multiplicacionSuma,resta,multiplicacion
Suma,resta,multiplicacion
 
Suma de dos_numeros
Suma de dos_numerosSuma de dos_numeros
Suma de dos_numeros
 
HOLA MUNDO
HOLA MUNDOHOLA MUNDO
HOLA MUNDO
 
Todas las apps
Todas las appsTodas las apps
Todas las apps
 
sumar,restar,multiplicar,dividr app eclipse
sumar,restar,multiplicar,dividr app eclipsesumar,restar,multiplicar,dividr app eclipse
sumar,restar,multiplicar,dividr app eclipse
 
programa sueldo final
programa sueldo finalprograma sueldo final
programa sueldo final
 
programa eclipse
programa eclipseprograma eclipse
programa eclipse
 
Operaciones con spinner (1)
Operaciones con spinner (1)Operaciones con spinner (1)
Operaciones con spinner (1)
 
Operaciones aritmeticas utilizando_radio_button
Operaciones aritmeticas utilizando_radio_buttonOperaciones aritmeticas utilizando_radio_button
Operaciones aritmeticas utilizando_radio_button
 
Spinner
SpinnerSpinner
Spinner
 
radiobuttom
radiobuttomradiobuttom
radiobuttom
 
Programas para sumar_restar_multiplicar_y dividir
Programas para sumar_restar_multiplicar_y dividirProgramas para sumar_restar_multiplicar_y dividir
Programas para sumar_restar_multiplicar_y dividir
 
Desarrollo movil
Desarrollo movil Desarrollo movil
Desarrollo movil
 
Programas para sumar, restar, multiplicar y dividir
Programas para sumar, restar, multiplicar y dividirProgramas para sumar, restar, multiplicar y dividir
Programas para sumar, restar, multiplicar y dividir
 
Tutorial eclipse
Tutorial eclipseTutorial eclipse
Tutorial eclipse
 
Preguntas de codeacademy
Preguntas de codeacademyPreguntas de codeacademy
Preguntas de codeacademy
 

Último

NUVO PROGRAMAS DE ESCUELAS NUEVO-ACUERDO-CTE.pdf
NUVO PROGRAMAS DE ESCUELAS NUEVO-ACUERDO-CTE.pdfNUVO PROGRAMAS DE ESCUELAS NUEVO-ACUERDO-CTE.pdf
NUVO PROGRAMAS DE ESCUELAS NUEVO-ACUERDO-CTE.pdfisrael garcia
 
libro de Ciencias Sociales_6to grado.pdf
libro de Ciencias Sociales_6to grado.pdflibro de Ciencias Sociales_6to grado.pdf
libro de Ciencias Sociales_6to grado.pdfFAUSTODANILOCRUZCAST
 
Buscadores, SEM SEO: el desafío de ser visto en la web
Buscadores, SEM SEO: el desafío de ser visto en la webBuscadores, SEM SEO: el desafío de ser visto en la web
Buscadores, SEM SEO: el desafío de ser visto en la webDecaunlz
 
INSTITUCION EDUCATIVA LA ESPERANZA SEDE MAGDALENA
INSTITUCION EDUCATIVA LA ESPERANZA SEDE MAGDALENAINSTITUCION EDUCATIVA LA ESPERANZA SEDE MAGDALENA
INSTITUCION EDUCATIVA LA ESPERANZA SEDE MAGDALENAdanielaerazok
 
Guia para el registro en el sitio slideshare.pdf
Guia para el registro en el sitio slideshare.pdfGuia para el registro en el sitio slideshare.pdf
Guia para el registro en el sitio slideshare.pdflauradbernals
 
Institucion educativa la esperanza sede la magdalena
Institucion educativa la esperanza sede la magdalenaInstitucion educativa la esperanza sede la magdalena
Institucion educativa la esperanza sede la magdalenadanielaerazok
 
institucion educativa la esperanza sede magdalena
institucion educativa la esperanza sede magdalenainstitucion educativa la esperanza sede magdalena
institucion educativa la esperanza sede magdalenajuniorcuellargomez
 
COMOGANARAMIGODPARACRISTOIGLESIAADVENTISTANECOCLI,COM
COMOGANARAMIGODPARACRISTOIGLESIAADVENTISTANECOCLI,COMCOMOGANARAMIGODPARACRISTOIGLESIAADVENTISTANECOCLI,COM
COMOGANARAMIGODPARACRISTOIGLESIAADVENTISTANECOCLI,COMcespitiacardales
 
COMPETENCIAS CIUDADANASadadadadadadada .pdf
COMPETENCIAS CIUDADANASadadadadadadada .pdfCOMPETENCIAS CIUDADANASadadadadadadada .pdf
COMPETENCIAS CIUDADANASadadadadadadada .pdfOscarBlas6
 
12 Clasificacion de las Computadoras.pdf
12 Clasificacion de las Computadoras.pdf12 Clasificacion de las Computadoras.pdf
12 Clasificacion de las Computadoras.pdfedwinmelgarschlink2
 

Último (10)

NUVO PROGRAMAS DE ESCUELAS NUEVO-ACUERDO-CTE.pdf
NUVO PROGRAMAS DE ESCUELAS NUEVO-ACUERDO-CTE.pdfNUVO PROGRAMAS DE ESCUELAS NUEVO-ACUERDO-CTE.pdf
NUVO PROGRAMAS DE ESCUELAS NUEVO-ACUERDO-CTE.pdf
 
libro de Ciencias Sociales_6to grado.pdf
libro de Ciencias Sociales_6to grado.pdflibro de Ciencias Sociales_6to grado.pdf
libro de Ciencias Sociales_6to grado.pdf
 
Buscadores, SEM SEO: el desafío de ser visto en la web
Buscadores, SEM SEO: el desafío de ser visto en la webBuscadores, SEM SEO: el desafío de ser visto en la web
Buscadores, SEM SEO: el desafío de ser visto en la web
 
INSTITUCION EDUCATIVA LA ESPERANZA SEDE MAGDALENA
INSTITUCION EDUCATIVA LA ESPERANZA SEDE MAGDALENAINSTITUCION EDUCATIVA LA ESPERANZA SEDE MAGDALENA
INSTITUCION EDUCATIVA LA ESPERANZA SEDE MAGDALENA
 
Guia para el registro en el sitio slideshare.pdf
Guia para el registro en el sitio slideshare.pdfGuia para el registro en el sitio slideshare.pdf
Guia para el registro en el sitio slideshare.pdf
 
Institucion educativa la esperanza sede la magdalena
Institucion educativa la esperanza sede la magdalenaInstitucion educativa la esperanza sede la magdalena
Institucion educativa la esperanza sede la magdalena
 
institucion educativa la esperanza sede magdalena
institucion educativa la esperanza sede magdalenainstitucion educativa la esperanza sede magdalena
institucion educativa la esperanza sede magdalena
 
COMOGANARAMIGODPARACRISTOIGLESIAADVENTISTANECOCLI,COM
COMOGANARAMIGODPARACRISTOIGLESIAADVENTISTANECOCLI,COMCOMOGANARAMIGODPARACRISTOIGLESIAADVENTISTANECOCLI,COM
COMOGANARAMIGODPARACRISTOIGLESIAADVENTISTANECOCLI,COM
 
COMPETENCIAS CIUDADANASadadadadadadada .pdf
COMPETENCIAS CIUDADANASadadadadadadada .pdfCOMPETENCIAS CIUDADANASadadadadadadada .pdf
COMPETENCIAS CIUDADANASadadadadadadada .pdf
 
12 Clasificacion de las Computadoras.pdf
12 Clasificacion de las Computadoras.pdf12 Clasificacion de las Computadoras.pdf
12 Clasificacion de las Computadoras.pdf
 

practica 1

  • 1. OPERACIONES ARITMETICAS CETIS 109 YAMARY SÁNCHEZ RAMOS EMILIANO GONZÁLEZ MÉNDEZ CARLOS SAMUEL GUTIÉRREZ RODRÍGUEZ JUAN ALBERTO DE JESÚS GARCÍA VÁZQUEZ 4° DM PROGRAMACION MARGARITA ROMERO ALVARADO
  • 2. PASO 1: • Primero empezamos un nuevo Android Aplication Proyect y ponemos el nombre que gusten.
  • 3. PASO 2: Insertamos un relative layout Después radio group y automáticamente aparecerán 3 radio button, borramos 1 porque solo ocuparemos 2 después agregamos un botón que se llame CALCULAR, después agregamos tres textview Se llamaran DAME UN NUMERO, DAME OTRO NUMERO y resultado, y por su puesto 2 textfields debajo de los 2 primeros textview.
  • 4. PASO 3: • Debemos ir a Package Explorer para poder abrir MainActivity en el cual se encuentra nuestro código
  • 5. package com.example.programa5; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; import android.widget.RadioButton; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstan ceState); setContentView(R.layout.acti vity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.m enu.main, menu); return true; } public void operar(View view) { EditText et1=(EditText)findViewById(R.id.et1); EditText et2=(EditText)findViewById(R.id.et2); TextView tv3=(TextView)findViewById(R.id.tv3); RadioButton radio0=(RadioButton)findViewById(R.id.radio0); RadioButton radio1=(RadioButton)findViewById(R.id.radio1); int nro1=Integer.parseInt(et1.getText().toString()); int nro2=Integer.parseInt(et2.getText().toString()); if (radio0.isChecked()==true) { int suma=nro1+nro2; String resu=String.valueOf(suma); tv3.setText(resu); } else if (radio1.isChecked()==true) { int resta=nro1-nro2; String resu=String.valueOf(resta); tv3.setText(resu); } } }
  • 7. PASO 5: • Ahora guardamos todos los cambios para poder hacer el siguiente paso
  • 8. PASO 6: • Por ultimo corremos el programa yendo a la carpeta que esta en package Explorer y le damos Run As y en nuestra primera opción para poder abrir el emulador y correr nuestra aplicación para poder hacer las pruebas y LISTO!! Terminamos.
  • 9. CONCLUSIÓN: • Existe un error en la acción del botón que hay que prestarle mucha acción porque ese simple error puede perjudicar todo el programa y no correrá y se cerrara automáticamente. Carlos Samuel Gutiérrez Rodríguez 4DM