public static void main(String[] args) { Scanner bro = new Scanner( System.in ); System.out.println("Enter name your personage"); String name = bro.nextLine(); int age = 0; int IQ = 0; System.out.println("Age your personage: " + age + " and IQ your personage: " + IQ); System.out.println("what are you going to do? ..skip 7 years.. or ..go to kindergarten..?"); String doing = bro.nextLine(); if (doing.equals("skip 7 years") && age < 7) System.out.println("ok! Your IQ = " + (IQ + 15) +" and your age " + (age + 7 )); else if (doing.equals("go to kindergarten") && age < 7);// ополнить else if (("go to kindergarten" != doing.equals() && age < 7) | ("skip 7 years" != doing.equals() && age < 7)); if ((doing.equals("go to kindergarten") && age < 7)| (doing.equals("skip 7 years") && age < 7)) { System.out.println("Please enter a valid value"); } int temp = 1;
start:
System.out.println("Answers must be between 1 and 15"); temp = bro.nextInt();
import java.util.Scanner;
public class gg {
public static void main(String[] args) {
Scanner bro = new Scanner( System.in );
System.out.println("Enter name your personage");
String name = bro.nextLine();
int age = 0;
int IQ = 0;
System.out.println("Age your personage: " + age + " and IQ your personage: " + IQ);
System.out.println("what are you going to do? ..skip 7 years.. or ..go to kindergarten..?");
String doing = bro.nextLine();
if (doing.equals("skip 7 years") && age < 7) System.out.println("ok! Your IQ = " + (IQ + 15) +" and your age " + (age + 7 ));
else if (doing.equals("go to kindergarten") && age < 7);// ополнить
else if (("go to kindergarten" != doing.equals() && age < 7) | ("skip 7 years" != doing.equals() && age < 7));
if ((doing.equals("go to kindergarten") && age < 7)| (doing.equals("skip 7 years") && age < 7)) {
System.out.println("Please enter a valid value");
}
int temp = 1;
start:
System.out.println("Answers must be between 1 and 15");
temp = bro.nextInt();
if(temp >=1 && temp <= 15)
{
return temp;
}
else
{
System.out.println("Please enter a valid value");
break start;
}
}
}