Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Author: Kaitlyn Fleeger
- //Purpose: Math
- import java.util.*;
- public class PrintStudentRoster{
- public static void main(String[]args){
- System.out.println("Please enter the number of students in the class.");
- Scanner fridge = new Scanner(System.in);
- int students = fridge.nextInt();
- System.out.println("Please enter the names seperated by spaces.");
- String[] names = new String[students];
- for(int i=0; i<names.length; i++){
- names[i] = fridge.next();
- }
- System.out.println("Student Roster");
- for(int i=0; i<students; i++){
- System.out.println(names[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement