SHARE
TWEET

Untitled

a guest Oct 21st, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.example.parcial3;
  2.  
  3. import androidx.appcompat.app.AppCompatActivity;
  4.  
  5. import android.app.Activity;
  6. import android.content.res.Resources;
  7. import android.os.Bundle;
  8. import android.widget.Button;
  9.  
  10. public class Arreglos extends MainActivity
  11. {
  12.     Resources Rico =getResources();
  13.     String Carnet[]=Rico.getStringArray(R.array.Carnet);
  14.     String Nombre[]=Rico.getStringArray(R.array.Nombres);
  15.     String Nota1[]=Rico.getStringArray(R.array.N1);
  16.     String Nota2[]=Rico.getStringArray(R.array.N2);
  17.     String Nota3[]=Rico.getStringArray(R.array.N3);
  18.     public double promedio()
  19.     {
  20.         double Promedio=0;
  21.         for(int i=0;i<Carnet.length;i++)
  22.         {
  23.             Promedio=((Double.parseDouble(Nota1[i]))+(Double.parseDouble(Nota2[i]))+(Double.parseDouble(Nota3[i])))/3;
  24.         }
  25.         return Promedio;
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top