title: how to subtraction, multiplication and division with looping statement
body: <p>i am create android application for subtraction, multiplication, division and addition with looping statement</p>
  
  <pre><code>case 1: if user insert= 3 then looping = 3x
  case 2: user input 1st looping = 5 then dialog show = 5
  case 3: user input 2nd = 10 then dialog show 5+10
  case 4: user input 3rd = 90 then dialog show 5+10+90
  </code></pre>
  
  <p>this is my code for addition</p>
  
  <pre><code>package com.test.testing;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.app.AlertDialog;
  import android.content.DialogInterface;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.widget.EditText;
  
  public class arithmatic extends Activity {
  
       int y = 0;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          //setContentView(R.layout.activity_main);
          final LayoutInflater inflater = this.getLayoutInflater();
          final View v=inflater.inflate(R.layout.dialoginputloop, null);
  
          new AlertDialog.Builder(arithmatic.this)
         // .setIcon(R.drawable.ic_launcher)
          .setTitle("Operator")
          .setView(v)
          .setPositiveButton("Ok", new DialogInterface.OnClickListener() {
           public void onClick(DialogInterface dialog, int whichButton) {
  
                EditText op = (EditText)v.findViewById(R.id.operator);
                int n = Integer.valueOf(op.getText().toString());
  
              for (int i = 0;i&lt;n;i++){
  
                  LayoutInflater inflater = arithmatic.this.getLayoutInflater();
                  final View v2=inflater.inflate(R.layout.dialoginputnumber, null) ;
                  new AlertDialog.Builder(arithmatic.this)
                      //.setIcon(R.drawable.ic_launcher)
                      .setTitle("input number")
                      .setView(v2)
                      .setNeutralButton("Ok", new DialogInterface.OnClickListener() {
                          public void onClick(DialogInterface dlg, int sumthin) {
  
                              EditText number = (EditText)v2.findViewById(R.id.number);
                              String a = number.getText().toString();
                              int x = Integer.valueOf(a);
                              y = y + x; //my formula to addition looping
  
                              new AlertDialog.Builder(arithmatic.this)
                                  .setTitle("result")
                                  .setMessage(Integer.toString(y))
                                  .setNeutralButton("Close", new DialogInterface.OnClickListener() {
                                      public void onClick(DialogInterface dlg, int sumthin) {
                                      }
                                  })
                                  .show(); 
  
                          }
                    })
                    .show();
  
                }
  
               }
  
            })
  
            .setNegativeButton("cancel", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int whichButton) {
  
                   finish();
                 }
             })
             .show();
      }
  }
  </code></pre>
  
  <p>how to create formula to subtraction, multiplication and division?</p>