write a java program to accept name and age of student check whether major or minor print the name and age of student also print "college student" if the student is major otherwise print "school student" (major means age greater than or equal to 18)
Answers
Answered by
13
import java.util.*;
public class Student
{
public static void main(String args[])
{
Scanner in = new Scanner(System.in);
int age;
String "name", "College student";
System.out.println("Input the age");
age=in.nextInt();
System.out.println("name="+ name);
name=in.nextString();
System.out.println("College student=" + College student);
College student = in.nextString();
if(age>=18)
{
System.out.println("major");
}
else
{
System.out.println("minor");
}
}
}
Similar questions
Math,
6 months ago
Math,
6 months ago
English,
6 months ago
Math,
11 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago
Math,
1 year ago