NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

vize final hesaplama
public class MainActivity extends AppCompatActivity {
EditText txtad;
Spinner spinnervize,spinnerfinal;
Button btnkaydet;

private String[]
vizee={"10","20","30","40","50","60","70","80","90"," 100"};
private String[]
finall={"10","20","30","40","50","60","70","80","90", "100"};
private Spinner spinnerfinall;
private Spinner spinnervizee;
private ArrayAdapter<String> dataAdaptervize;
private ArrayAdapter<String> dataAdapterfinal;
int bn;
int vizeNotu;
int finalNotu;
@Override
protected void onCreate(Bundle
savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
txtad=findViewById(R.id.txtad);
spinnervize=findViewById(R.id.spinnervize);
spinnerfinal=findViewById(R.id.spinnerfinal);
btnkaydet=findViewById(R.id.btnkaydet);
spinnervize=(Spinner)
findViewById(R.id.spinnervize);
spinnerfinal=(Spinner)
findViewById(R.id.spinnerfinal);
dataAdaptervize = new

ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, vizee);
dataAdapterfinal = new
ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item,finall);

dataAdaptervize.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
dataAdapterfinal.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnervize.setAdapter(dataAdaptervize);
spinnerfinal.setAdapter(dataAdapterfinal);


btnkaydet.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {

vizeNotu = Integer.parseInt(spinnervize.getSelectedItem().toString());
finalNotu = Integer.parseInt(spinnerfinal.getSelectedItem().toString());
bn = (int) ((vizeNotu * 0.4) + (finalNotu *0.6));
Intent intent =new Intent( MainActivity.this,Main2Activity.class);
intent.putExtra("ad",txtad.getText().toString());
intent.putExtra("bn",bn);
startActivity(intent);
}


});

}
}


<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
tools:layout_editor_absoluteY="25dp">

<EditText
android:id="@+id/txtad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:ems="10"
android:inputType="textPersonName"
android:text="Name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<Spinner
android:id="@+id/spinnervize"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="18dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtad" />

<Spinner
android:id="@+id/spinnerfinal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="35dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spinnervize" />

<Button
android:id="@+id/btnkaydet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="57dp"
android:text="kayıt"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spinnerfinal" />

</android.support.constraint.ConstraintLayout>


sonuc:


public class Main2Activity extends AppCompatActivity {

TextView txtadsonuc,bntxt;
String ad;
int bn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
txtadsonuc=findViewById(R.id.txtadsonuc);
bntxt = findViewById(R.id.txdnot);
Bundle intent = getIntent().getExtras();
ad=intent.getString("ad");
bn = intent.getInt("bn");
txtadsonuc.setText(ad);
bntxt.setText((String.valueOf(bn)));
}
}

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Main2Activity">

<TextView
android:id="@+id/txtadsonuc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="149dp"
android:layout_marginStart="149dp"
android:layout_marginTop="105dp"
android:text="TextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/txdnot"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:text="TextView"
tools:layout_editor_absoluteX="149dp"
tools:layout_editor_absoluteY="180dp" />
</android.support.constraint.ConstraintLayout>
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.