<?xml version="1.0" encoding="utf-8"?>
<?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"
android:background="@color/BackgroundContent"
tools:context="com.example.user.dbv2.Content_mainActivity"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="25dp">
<TextView
android:id="@+id/textView3"
android:layout_width="0dp"
android:layout_height="23dp"
android:layout_marginBottom="50dp"
android:layout_marginTop="49dp"
android:text="Вождение"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/textView7"
app:layout_constraintLeft_toLeftOf="@+id/textView7"
app:layout_constraintRight_toRightOf="@+id/textView4"
app:layout_constraintTop_toTopOf="parent"
tools:layout_constraintBottom_creator="1"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintRight_creator="1"
tools:layout_constraintTop_creator="1"/>
<TextView
android:id="@+id/textView4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Теория"
android:textSize="17sp"
app:layout_constraintBottom_toTopOf="@+id/textView8"
app:layout_constraintLeft_toLeftOf="@+id/textView8"
app:layout_constraintRight_toRightOf="@+id/teor"
tools:layout_constraintBottom_creator="1"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintRight_creator="1"/>
<TextView
android:id="@+id/textView7"
android:layout_width="60dp"
android:layout_height="50dp"
android:layout_marginStart="108dp"
android:layout_marginTop="72dp"
android:gravity="center_vertical"
android:text="Где:"
android:textSize="17sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintTop_creator="1"/>
<TextView
android:id="@+id/textView6"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center_vertical"
android:text="Когда:"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/discr_for_tasks_test"
app:layout_constraintLeft_toLeftOf="@+id/textView7"
app:layout_constraintRight_toRightOf="@+id/textView7"
app:layout_constraintTop_toBottomOf="@+id/textView7"
tools:layout_constraintBottom_creator="1"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintRight_creator="1"
tools:layout_constraintTop_creator="1"/>
<ListView
android:id="@+id/discr_for_tasks_test"
android:layout_width="0dp"
android:layout_height="50dp"
android:divider="@null"
android:textSize="17sp"
app:layout_constraintLeft_toLeftOf="@+id/discr_for_tasks"
app:layout_constraintRight_toRightOf="@+id/discr_for_tasks"
app:layout_constraintTop_toBottomOf="@+id/discr_for_tasks"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintRight_creator="1"
tools:layout_constraintTop_creator="1"/>
<TextView
android:id="@+id/textView8"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="48dp"
android:gravity="center_vertical"
android:text="Где:"
android:textSize="17sp"
app:layout_constraintLeft_toLeftOf="@+id/textView6"
app:layout_constraintRight_toRightOf="@+id/textView6"
app:layout_constraintTop_toBottomOf="@+id/textView6"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintRight_creator="1"
tools:layout_constraintTop_creator="1"/>
<TextView
android:id="@+id/textView9"
android:layout_width="0dp"
android:layout_height="50dp"
android:gravity="center_vertical"
android:text="Когда:"
android:textSize="17sp"
app:layout_constraintLeft_toLeftOf="@+id/textView8"
app:layout_constraintRight_toRightOf="@+id/textView8"
app:layout_constraintTop_toBottomOf="@+id/textView8"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintRight_creator="1"
tools:layout_constraintTop_creator="1"/>
<ListView
android:id="@+id/discr_for_tasks"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginEnd="15dp"
android:layout_marginStart="1dp"
android:divider="@null"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/textView7"
app:layout_constraintLeft_toRightOf="@+id/textView7"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3"
tools:layout_constraintBottom_creator="1"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintRight_creator="1"
tools:layout_constraintTop_creator="1"/>
<ListView
android:id="@+id/teor"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginEnd="1dp"
android:divider="@null"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@+id/textView8"
app:layout_constraintLeft_toRightOf="@+id/textView8"
app:layout_constraintRight_toRightOf="@+id/discr_for_tasks_test"
app:layout_constraintTop_toBottomOf="@+id/textView4"
tools:layout_constraintBottom_creator="1"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintRight_creator="1"
tools:layout_constraintTop_creator="1"/>
<ListView
android:id="@+id/teor2"
android:layout_width="0dp"
android:layout_height="50dp"
android:divider="@null"
android:textSize="17sp"
app:layout_constraintLeft_toLeftOf="@+id/teor"
app:layout_constraintRight_toRightOf="@+id/teor"
app:layout_constraintTop_toBottomOf="@+id/teor"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintRight_creator="1"
tools:layout_constraintTop_creator="1"/>
</android.support.constraint.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#bdbdbd"/>
<corners android:radius="30dp" />
</shape>
</item>
</selector>
<Button
android:id ="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Some Button"
android:background="@drawable/rounded_button"
android:padding="16dp"/>
package count;
import java.util.Scanner;
public class Dick {
static int x;
static int y;
public static void main (String args[]) {
scan();
x = count(x);
y = count(y);
System.out.println("Теперь ваше первое число =" + x);
System.out.println("Теперь ваше первое число =" + y);
name(); //добавляем вызов метода name
}
private static int count (int m){
m = m + 1;
return m;
}
public static void scan () {
System.out.println("Введите первое число");
Scanner scn = new Scanner(System.in);
x = scn.nextInt();
System.out.println("Введите второе число");
y = scn.nextInt();
}
public static void name(){
int p;
//scan();
p = x + y;
System.out.println("Теперь сумма ваших чисел =" +p);
}
}
double output = Double.parseDouble(mEditText.getText().toString());
output = Math.round(output * 100.0) / 100.0;
mTextView.setText(String.valueOf(output));
output = Double.parseDouble(mEditText.getText().toString());
mTextView.setText(new DecimalFormat("##.##").format(output)); //import java.text.DecimalFormat;