Question: Create a Java project called Lab8-Q3. Inside this project create a class named Q3 with a main function. Also create a class named Student. The

Create a Java project called Lab8-Q3. Inside this project create a class named "Q3" with a main function. Also create a class named "Student".

The main function should have the following lines of code

Student Chris = new Student("Chris Chambers" , "Z3453234");

Chris.StudentProfile();

Student Tom = new Student();

Tom.StudentProfile();

Student.NumStudents();

and output the following

Name: Chris Chambers

ZNumber: Z3453234

Enter the students name:

Tom Brady

Enter the students Z number:

Z3425890

Name: Tom Brady

ZNumber: Z3425890

There are 2 students

The class Student should have the following variables

private static int studentCount = 0;

private String studentName;

private String studentZNumber;

The constructor for Student should be overloaded. If it is passed two strings as arguments it

will assign values to the variables studentName and studentZNumber. If it is passed no

arguments then it will prompt the user to enter the Students Name and Z Number.

The static variable studentCount will keep tracking of how many students have been created.

The method StudentProfile() will print out the students name and Z number.

NumStudents() will be a static method that print out how many students have been created.

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