Your task is to create a program that can achieve the above requirements when given the students surname, first name and three digit postfix through CMD arguements
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
String surname;
String firstname;
int digit;
System.out.println("Enter surname: ");
surname=in.next();
System.out.println("Enter first name: ");
firstname=in.next();
System.out.println("Enter three digit postfix: ");
digit=in.nextInt();
System.out.println("Surname: "+surname);
System.out.println("First name: "+firstname);
System.out.println("Digit: "+digit);
}
}
Comments
Leave a comment