Question: Copy / paste the following code into a file and save as StudentRegistration.java. It may or may not compile in its present state, but part

Copy/paste the following code into a file and save as StudentRegistration.java. It may or may not compile in its present state, but part of your task is to get it to a compiling state. Notice that you only have to write a portion of the code, this time.
import java.util.Scanner;
import java.util.Random;
public class StudentRegistration {
public static void main (String[] args){
String name;
int studentID;
String major;
int school;
char taskCompleted;
String messageToStudent;
Scanner scan = new Scanner(System.in);
Random rGen = new Random();
System.out.print("What is your name? ");
name = scan.nextLine();
System.out.println();
studentID = Math.abs(rGen.nextInt());
System.out.println("Your student id number is: "+ studentID);
System.out.println();
System.out.print("What is your major? ");
major = scan.nextLine();
System.out.println();
System.out.println("What school is this?
1= Engineering
2= Business
(Or any other number for liberal arts)");
System.out.println();
System.out.print("Please enter the number: ");
school = scan.nextInt();
scan.nextLine();
System.out.println();
// Depending on which school the student belongs to...
//*Ask the student the appropriate yes/no question
//*Store the FIRST character of their response inside
// the variable taskCompleted
//*Assign the appropriate String to the variable
// messageToStudent
// For students in the Engineering school, ask if they have
// started their engineering project yet. If so, the
// message is: "Good for you! Keep me updated on your progress!"
// Otherwise: "That's not good at all. It's nearly November!"
// For students in the Business school, ask if they have
// found an internship yet. If so, the
// message is: "Congratulations! I know you must have impressed
// the company quite a bit."
// Otherwise: "You may be out of luck because most of the
// internships are probably gone by now."
// For students in the Liberal Arts school, ask if they have
// started their engineering project yet. If so, the
// message is: "That sounds interesting, and I look forward to reading it."
// Otherwise: "You're going to be under a huge time crunch,
// if you don't even have a topic by this point."
// YOUR CODE GOES HERE
System.out.println();
System.out.println(messageToStudent);
}
}
Your task, then, is to follow the directions in the comments in order to direct the program to carry out the appropriate steps depending on various conditions. Note that because some values are being assigned at random or based on user input, the output will look different each time you run the program. To this end, I have provided multiple examples of how the output could look.
Program output examples:
Example 1:
What is your name? Bob
Your student id number is: 926177707
What is your major? IT
What school is this?
1= Engineering
2= Business
(Or any other number for liberal arts)
Please enter the number: 1
Bob, have you started your senior engineering project yet?
no
That's not good at all. It's nearly November!
Example 2:
What is your name? Bill
Your student id number is: 2147090693
What is your major? Marketing
What school is this?
1= Engineering
2= Business
(Or any other number for liberal arts)
Please enter the number: 2
Bill, have you found an internship yet?
yes
Congratulations! I know you must have impressed the company quite a bit.
Example 3:
What is your name? Jack
Your student id number is: 697306010
What is your major? English
What school is this?
1= Engineering
2= Business
(Or any other number for liberal arts)
Please enter the number: 3
Jack, have you decided on a senior thesis topic yet?
yes
That sounds interesting, and I look forward to reading it.
What should go in between YOUR CODE GOES HERE to make the program work?

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 Accounting Questions!