Assignment problems:

Write Java programs for each of the following.
1. Students in a university class are being organized into groups of three for
an upcoming research project. To model this situation:

a. Write a Student class that stores the name, email address and phone
number of a single student. Include two constructors - one that allows
initial values to be set for each of these attributes via parameters and a
second that simply initializes the attributes to empty strings. Your class
should have getter and setter methods for all attributes as well as a
toString method that returns all information about the student in a nicely
formatted string.

b. Write a Group class to collect the three students comprising a group.
Your class should have a single getter and a single setter method to get or
set a particular student. Note that the caller will indicate which student
(1,2 or 3) is to be gotten or set via a parameter. Also include a simple
constructor that sets the three students to null and a toString method that
returns all information about all students in the group.

c. Write a driver class to create a couple of groups, populate them with
students and test your methods.

ƒnDefine a new class Coordinator that represent a faculty member who works a certain number of hours each month. In this case, the salary is computed by multiplying the working hours by the hourly payment rate.

„σnCreate a new object of class Coordinator and add it to the list created in the exercise above. Display its information including the salary

Write students name using constructor in java program

To complete this assignment, you will need to write three Java classes: Student, Group, and the Driver class. I will provide a step-by-step guide for each class.

1. Student Class:
a. Open your Java IDE (Integrated Development Environment) and create a new Java class named "Student."
b. Inside the Student class, declare three private instance variables: name, email, and phone. These variables will store the information for a single student.
c. Create two constructors:
- The first constructor should have parameters for name, email, and phone. Inside the constructor, assign the parameter values to the respective instance variables.
- The second constructor should be parameterless and initialize the instance variables with empty strings.
d. Write getter and setter methods for each instance variable. These methods allow access to and modification of the private variables.
e. Implement a toString() method that returns a formatted string representing all the information about the student. You can use String concatenation or the StringBuilder class for formatting.

2. Group Class:
a. Create a new Java class named "Group."
b. Inside the Group class, declare three private instance variables: stu1, stu2, and stu3. These variables will represent the three students in the group.
c. Create a parameterless constructor that initializes stu1, stu2, and stu3 to null.
d. Implement getter and setter methods for each student variable. The methods should accept an index (1, 2, or 3) indicating which student to get or set.
e. Write a toString() method that returns a formatted string representing all the information about all the students in the group. You can utilize the toString() method of the Student class for this purpose.

3. Driver Class:
a. Create a new Java class, for example, named "Main," to serve as the driver class.
b. Inside the Main class, create the main() method which serves as the entry point of your program.
c. Inside the main() method, create instances of the Student class to represent individual students, provide necessary information using the appropriate constructor and setter methods.
d. Next, create instances of the Group class and add the students to the groups using the appropriate setter methods.
e. Finally, test your program by printing the information about the groups and their students using the toString() method.

Remember to compile and run your program after completing each step to check for any syntax or logical errors.