March 29, 2015


Posted by AHMED on Monday, October 15, 2012 at 4:52pm.

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.

Answer this Question

First Name:
School Subject:

Related Questions

COMPUTER SCIENCE JAVA - Assignment problems: Write Java programs for each of the...
Java Programming - I'm new to Java and I'm not sure how to write the source code...
Java - I am trying to write an algorithm for my JAVA class and am having some ...
Computer Language Java - What is the concept of multi-threading in java and how ...
computer science - Hi, I have this quick question: A Java interface can be used ...
Computer Science-Java - Hi, I have to write a method that returns my first name...
Computer Science - Design a GUI java application which dsipalys data of an array...
Computer Science - Java - Hi, For an assignment I am doing, we have to have 2 ...
java - Write a java application that finds the smallest of several integers. ...
Computer Science - Consider the following application files: /JavaCS1/src/...