package ifexample;
import java.util.Scanner;
public class IfExample2 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int age = scanner.nextInt();
int charge = 0;
if( age <8) {
charge = 1000;
}
else if( age<14) {
charge = 1500;
System.out.println("초등생");
}
else if( age<20) {
charge = 2000;
System.out.println("중고등생");
}
else {
charge = 3000;
}
System.out.println("나이:"+age);
System.out.println("요금:"+charge);
}
}
package ifexample;
import java.util.Scanner;
public class IfExample3 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int score = scanner.nextInt();
char grade;
if( score >=90) {
grade = 'A';
}
else if( score>=80) {
grade = 'B';
}
else if( score>=70) {
grade='C';
}
else if(score>=60){
grade = 'D';
}
else {
grade ='F';
}
System.out.println("점수:"+score);
System.out.println("학점:"+grade);
}
}