Programa32

7
CETIS 109 RAMIREZ MORALES ALEXIS ALBERTO 4 AM PROGRAMACION DESARROLLA APLICACIONES MOVILES MCA MARGARITA ROMERO ALVARADO

Transcript of Programa32

Page 1: Programa32

CETIS 109

RAMIREZ MORALES ALEXIS ALBERTO

4 AM PROGRAMACION

DESARROLLA APLICACIONES MOVILES

MCA MARGARITA ROMERO ALVARADO

Page 2: Programa32

1.- EMPEZAREMOS ABRIENDO ECLIPSE.

2.- SELECCIONAMOS FILE->NEW->ANDROIDAPPLICATIONPROJECT.

3.-DESPUES PONDREMOS EL NOMBRE DEL PROGRAMA QUE VAMOS HACER.

LE DAREMOS NEXT HASTA CUANDO APAREZCA FINISH PARA EMPEZAR HACER EL PROGRAMA.

Page 3: Programa32
Page 4: Programa32

package com.example.programatres;

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;

}

Page 5: Programa32

public void calcular (View v){

EditText s=(EditText) FindViewById (R.id.sueldo);

TextView i=(TextView) FindViewById (R.id.ispt);

TextView sa=(TextView) FindViewById (R.id.salario);

double su=Double.parseDouble(s.getText().toString());

double is=su*0.16;

double st=su-is;

i.setText(String.valueof(is));

Sa.setText(String.valueof(st));

}

Page 6: Programa32

200

184

El programa terminado tiene que aparecer en la pantalla

con el sueldo de una persona y tiene que salir el

resultado del sueldo.

Page 7: Programa32

Opinion Personal

El programa eclipse al principio es muy complicado hacerlo pero conforme lo estamos

haciendo se va facilitando poco a poco.