Complete the following
StudentIdDriverclass skeleton by replacing all six occurrences of
StudentIdclass, which is below the
StudentIdDriverclass. The two classes are in separate files.
import java.util.Scanner;public class StudentIdDriver{ public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); StudentId student; String name; // Instantiate a Studentld object and assign it to student.System.out.print(“Enter student name: “); name = stdIn.nextLine( ); // Assign name to the student object.
System.out.print(“Enter student id: “); // In a single line, read an int for the id value, // and assign it to the student object.// If invalid id, execute the loop. // (Use the isValid method in the while loop condition.) while () { System.out.print(“Invalid student id - reenter: “); // In a single line, read an int for the id value // and assign it to the student object.
} System.out.println(“\n” + name + “, your new e-mail account is: \n” +
// Get email account. } // end main} // end class StudentIdDriverpublic class StudentId{ private String name; private int id; //********************************************************* public void setName(String n) { this.name = n; } public String getName() { return this.name; } public void setId(int id) { this.id = id; } public int getId() { return this.id; } //********************************************************* public String getEmailAccount() { // Include ““ in concatenation to convert to strings. return ““ + this.name.charAt(0) + this.id + “@pirate.park.edu”; } //********************************************************* public boolean isValid() { return this.id >= 100000 && this.id <= 999999; }} // end class StudentId
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.