How can I Write a Java programming
1.ask the use input the username
2.input the name in next line
and it can be content the student class
System.out.println(|Student Name : |)
use “ SList [i] getStudentname “
and display after the Student Name : Ada Sze
hins:
use for loop
do
while
else
import java.util.Scanner;
public class App {
/**
* The start point of the program
*
* @param args
*
*/
public static void main(String[] args) {
Scanner keyBoard = new Scanner(System.in);
for (int i = 0; i < 5; i++) {
System.out.print("Enter username: ");
String username = keyBoard.nextLine();
System.out.print("Enter name : ");
String name = keyBoard.nextLine();
System.out.println("Student username: " + username);
System.out.println("Student Name: " + name);
}
keyBoard.close();
}
}
Comments
Leave a comment