SlideShare una empresa de Scribd logo
1 de 21
Descargar para leer sin conexión
CETIS 109
VILLANUEVA EPIGMENIO KARLA
ESTEFANIA
4° AM
PROGRAMACION
DESARROLLA APLICACIONES
MOVILES
AULA 27
MCA MARGARITA ROMERO
ALVARADO
*UN NUMERO ELEVADO AL CUADRADO*
Package com.example.programa10;
Import android.os.Bundle;
Import android.app.Activity;
Import android.view.Menu;
Import android.view.View;
Import android.widget.EditText;
Import android.widget.TextView;
Public class MainActivity extends Activity {
@Override
Protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
Public boolean onCreateOptionsMenu(Menu menu) {
// inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
Return true;
}
Public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*n1;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*YARDAS A CENTIMETROS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*91.44;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*PULGADAS A METROS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*0.0254;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*HORA A MINUTOS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*60;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*MINUTOS A SEGUNDOS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*60;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*HORA A SEGUNDOS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*3600;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*METROS A MILÍMETROS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*1000;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*METROS A PULGADAS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*39.3700787;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*METROS A PIES*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*3.2808399;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*METROS A YARDAS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*1.0936133;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*KILÓMETROS A METROS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*1000;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*PULGADAS A CENTÍMETROS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*2.54;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*PIES A METROS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*0.3048;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*TONELADAS A KILOGRAMOS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*1000;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*YARDAS A CENTÍMETROS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*91.44;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*PIES A MILLAS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*0.000189393939;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*MILLAS A PIES*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*5280;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*PIES A CENTÍMETROS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*30.48;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*CENTÍMETROS CUBICOS A MILITROS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*1;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}
*METROS CÚBICOS A LITROS*
package com.example.programa10;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void multiplicar (View view){
EditText et1=(EditText) findViewById (R.id.num1);
TextView sol=(TextView) findViewById (R.id.res);
double n1=Double.parseDouble(et1.getText().toString());
double r;
r=n1*1000;
sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r));
}
}

Más contenido relacionado

Destacado (11)

What your Ring Reveals about you? “Infographic”
What your Ring Reveals about you? “Infographic”What your Ring Reveals about you? “Infographic”
What your Ring Reveals about you? “Infographic”
 
Netbeans4
Netbeans4 Netbeans4
Netbeans4
 
презентация Microsoft power point
презентация Microsoft power pointпрезентация Microsoft power point
презентация Microsoft power point
 
NCMA Government Property
NCMA Government PropertyNCMA Government Property
NCMA Government Property
 
бүлэг 4
бүлэг 4бүлэг 4
бүлэг 4
 
лекц 4
лекц 4лекц 4
лекц 4
 
Kidflier6.5
Kidflier6.5Kidflier6.5
Kidflier6.5
 
Celulares
CelularesCelulares
Celulares
 
лекц 1
лекц 1лекц 1
лекц 1
 
бүлэг 2
бүлэг 2бүлэг 2
бүлэг 2
 
лекц 9.10 pptx
лекц 9.10 pptxлекц 9.10 pptx
лекц 9.10 pptx
 

Similar a 20 códigos de eclipse

Similar a 20 códigos de eclipse (20)

20 codigos
20 codigos20 codigos
20 codigos
 
20 Codigos
20 Codigos20 Codigos
20 Codigos
 
HNUH
HNUHHNUH
HNUH
 
Programa 2
Programa 2Programa 2
Programa 2
 
Hola mundo12
Hola mundo12Hola mundo12
Hola mundo12
 
Guardar Android
Guardar AndroidGuardar Android
Guardar Android
 
F2
F2F2
F2
 
CODIGOS
CODIGOS CODIGOS
CODIGOS
 
Code
CodeCode
Code
 
List view languages
List view languagesList view languages
List view languages
 
Android Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and IntentAndroid Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and Intent
 
Androidppt 1
Androidppt 1Androidppt 1
Androidppt 1
 
Practical
PracticalPractical
Practical
 
Action bar
Action barAction bar
Action bar
 
Hi AndroidAnnotations
Hi AndroidAnnotationsHi AndroidAnnotations
Hi AndroidAnnotations
 
안드로이드 세미나 2
안드로이드 세미나 2안드로이드 세미나 2
안드로이드 세미나 2
 
안드로이드 세미나 2
안드로이드 세미나 2안드로이드 세미나 2
안드로이드 세미나 2
 
Android crashcourse
Android crashcourseAndroid crashcourse
Android crashcourse
 
Curso de Desenvolvimento Mobile - Android - Activities
Curso de Desenvolvimento Mobile - Android - ActivitiesCurso de Desenvolvimento Mobile - Android - Activities
Curso de Desenvolvimento Mobile - Android - Activities
 
Android wear (coding)
Android wear (coding)Android wear (coding)
Android wear (coding)
 

Más de Karla Estefania Villanueva Epigmenio (20)

Investigacion como insertar un vídeo en eclipse
Investigacion como insertar un vídeo en eclipseInvestigacion como insertar un vídeo en eclipse
Investigacion como insertar un vídeo en eclipse
 
Presentación
Presentación Presentación
Presentación
 
Presentación 16
Presentación 16Presentación 16
Presentación 16
 
Presentación 15
Presentación 15Presentación 15
Presentación 15
 
Como insetar una imagen en eclipse
Como insetar una imagen en eclipse Como insetar una imagen en eclipse
Como insetar una imagen en eclipse
 
Programa 11
Programa 11Programa 11
Programa 11
 
Programa 14
Programa 14Programa 14
Programa 14
 
Presentacion 13
Presentacion 13Presentacion 13
Presentacion 13
 
Presentación 12
Presentación 12Presentación 12
Presentación 12
 
Programa 11
Programa 11Programa 11
Programa 11
 
Programa 10
Programa 10Programa 10
Programa 10
 
Programa 9
Programa 9Programa 9
Programa 9
 
Programa 8
Programa 8Programa 8
Programa 8
 
Programa 7 eclipse
Programa 7 eclipsePrograma 7 eclipse
Programa 7 eclipse
 
Programa5
Programa5Programa5
Programa5
 
Programa4
Programa4Programa4
Programa4
 
Programa 6 de Eclipse
Programa 6 de EclipsePrograma 6 de Eclipse
Programa 6 de Eclipse
 
Eclipse
EclipseEclipse
Eclipse
 
Programa2
Programa2 Programa2
Programa2
 
Villanueva epigmenio
Villanueva epigmenio Villanueva epigmenio
Villanueva epigmenio
 

Último

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Último (20)

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

20 códigos de eclipse

  • 1. CETIS 109 VILLANUEVA EPIGMENIO KARLA ESTEFANIA 4° AM PROGRAMACION DESARROLLA APLICACIONES MOVILES AULA 27 MCA MARGARITA ROMERO ALVARADO
  • 2. *UN NUMERO ELEVADO AL CUADRADO* Package com.example.programa10; Import android.os.Bundle; Import android.app.Activity; Import android.view.Menu; Import android.view.View; Import android.widget.EditText; Import android.widget.TextView; Public class MainActivity extends Activity { @Override Protected void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override Public boolean onCreateOptionsMenu(Menu menu) { // inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); Return true; } Public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*n1; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 3. *YARDAS A CENTIMETROS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*91.44; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 4. *PULGADAS A METROS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*0.0254; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 5. *HORA A MINUTOS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*60; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 6. *MINUTOS A SEGUNDOS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*60; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 7. *HORA A SEGUNDOS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*3600; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 8. *METROS A MILÍMETROS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*1000; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 9. *METROS A PULGADAS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*39.3700787; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 10. *METROS A PIES* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*3.2808399; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 11. *METROS A YARDAS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*1.0936133; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 12. *KILÓMETROS A METROS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*1000; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 13. *PULGADAS A CENTÍMETROS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*2.54; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 14. *PIES A METROS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*0.3048; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 15. *TONELADAS A KILOGRAMOS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*1000; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 16. *YARDAS A CENTÍMETROS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*91.44; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 17. *PIES A MILLAS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*0.000189393939; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 18. *MILLAS A PIES* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*5280; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 19. *PIES A CENTÍMETROS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*30.48; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 20. *CENTÍMETROS CUBICOS A MILITROS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*1; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }
  • 21. *METROS CÚBICOS A LITROS* package com.example.programa10; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void multiplicar (View view){ EditText et1=(EditText) findViewById (R.id.num1); TextView sol=(TextView) findViewById (R.id.res); double n1=Double.parseDouble(et1.getText().toString()); double r; r=n1*1000; sol.setText(String.valueOf("El cuadrado del numero "+n1+" = "+r)); } }