Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

2. What role should job descriptions play in training at Apex?

Answered: 1 week ago