Centro de Estudio Tecnológicos Industrial
& Servicios 109.
Nombre: ADRIANA LIZBETH AVILA ORTIZ.
MARICARMEN AVILA ORTIZ
GRADO & GRUPO: 4° “BM”
PROFESORA: MARGARITA ROMERO
ALVARADO.
MATERIA:DESARROLLAR APLICACIONES
MOVIL.
AULA:31
CICLO ESCOLAR: FEB-JUN 2015.
 package com.programa7;
 import android.support.v7.app.ActionBarActivity;
 import android.os.Bundle;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
 import android.widget.EditText;
 import android.widget.TextView;
 public class MainActivity extends ActionBarActivity {
 @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;
 }
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
 // Handle action bar item clicks here. The action bar will
 // automatically handle clicks on the Home/Up button, so long
 // as you specify a parent activity in AndroidManifest.xml.
 int id = item.getItemId();
 if (id == R.id.action_settings) {
 return true;
 }
 return super.onOptionsItemSelected(item);
 }

 public void calcular (View view){
 EditText n=(EditText) findViewById (R.id.num1);
 TextView r=(TextView) findViewById (R.id.res);

 double d=Double.parseDouble(n.getText().toString());

 if(d<0){
 r.setText("Negativo");
 }
 r.setText("Positivo");
 }

 }
 Como podemos ver este
programa es muy fácil para
hacer ya que nomas es de seguir
todos los paso.

Programa 7

  • 1.
    Centro de EstudioTecnológicos Industrial & Servicios 109. Nombre: ADRIANA LIZBETH AVILA ORTIZ. MARICARMEN AVILA ORTIZ GRADO & GRUPO: 4° “BM” PROFESORA: MARGARITA ROMERO ALVARADO. MATERIA:DESARROLLAR APLICACIONES MOVIL. AULA:31 CICLO ESCOLAR: FEB-JUN 2015.
  • 13.
     package com.programa7; import android.support.v7.app.ActionBarActivity;  import android.os.Bundle;  import android.view.Menu;  import android.view.MenuItem;  import android.view.View;  import android.widget.EditText;  import android.widget.TextView;  public class MainActivity extends ActionBarActivity {  @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;  }
  • 14.
     @Override  publicboolean onOptionsItemSelected(MenuItem item) {  // Handle action bar item clicks here. The action bar will  // automatically handle clicks on the Home/Up button, so long  // as you specify a parent activity in AndroidManifest.xml.  int id = item.getItemId();  if (id == R.id.action_settings) {  return true;  }  return super.onOptionsItemSelected(item);  }   public void calcular (View view){  EditText n=(EditText) findViewById (R.id.num1);  TextView r=(TextView) findViewById (R.id.res);   double d=Double.parseDouble(n.getText().toString());   if(d<0){  r.setText("Negativo");  }  r.setText("Positivo");  }   }
  • 16.
     Como podemosver este programa es muy fácil para hacer ya que nomas es de seguir todos los paso.