Question: Given code: / / Main . java import java.io . * ; public class Main _ i { public static void main ( String args

Given code:
//Main.java
import java.io.*;
public class Main_i {
public static void main(String args[]) throws FileNotFoundException {
ClassList c = new ClassList("data.txt");
c.listStudents();
c.listPairs();
c.greeting();
}
}
//Pair.java
public class Pair {
private Student s1;
private Student s2;
// DO NOT add any extra object fields
}
//Student.java
public class Student {
private String name;
// DO NOT add any extra object fields
}
//ClassList.java
import java.io.*;
import java.util.*;
public class ClassList {
private Student[] sList;
private Pair[] pList;
// DO NOT add any extra object fields
public ClassList(String fpn) throws FileNotFoundException {
Scanner in = new Scanner(new File(fpn));
}
public void listStudents(){
System.out.println("Students: ");
}
public void listPairs(){
System.out.println("Pairs: ");
}
public void greeting(){
System.out.println("Greeting messages: ");
}
}
//Input file: data.txt
Ada
Bob
Candy
Dove
Emily
Frank
Gigi
Henry
Ivy
Joy
104
31
28
79
65
//Sample output
Students:
[1] Ada
[2] Bob
[3] Candy
[4] Dove
[5] Emily
[6] Frank
[7] Gigi
[8] Henry
[9] Ivy
[10] Joy
Pairs:
Pair 1: Joy Dove
Pair 2: Candy Ada
Pair 3: Bob Henry
Pair 4: Gigi Ivy
Pair 5: Frank Emily
Greeting messages:
Hi Candy, nice to meet you. I am Ada.
Hi Henry, nice to meet you. I am Bob.
Hi Ada, nice to meet you. I am Candy.
Hi Joy, nice to meet you. I am Dove.
Hi Frank, nice to meet you. I am Emily.
Hi Emily, nice to meet you. I am Frank.
Hi Ivy, nice to meet you. I am Gigi.
Hi Bob, nice to meet you. I am Henry.
Hi Gigi, nice to meet you. I am Ivy.
Hi Dove, nice to meet you. I am Joy.
Plz finish the JAVA code, thanks
Given code: / / Main . java import java.io . * ;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!