Question: . IST 240- L03 Lab: Java Complex Classe s What will be assessed Your knowledge of how to work with classes within classes Your knowledge

. IST 240- L03 Lab: Java Complex Classes

What will be assessed

Your knowledge of how to work with classes within classes

Your knowledge of how to use the DOT operation/notation

Deliverables

app.java, student.java and group.java as requested below.

Contents

Create an application that:

Creates 4 students

Build upon the solutions of the previous labs (e.g., using app.java and student.java)

You will need a version of student.java that has a working whatsup() method

Creates a groupFirst, you have to design the new Java class called group

A group has a name

A group has 4 students

Create two methods in group.java

a method that displays the group name and the name of each student in the group

a method that displays the participation in a group. Participation is the sum of all the group members' (students') participation. Participation is an int number that varies from 1 to 10 (1 meaning very little participation, 10 meaning great participation)

participation starts in student using a random number (in a similar fashion of whatsUp()) to return the student's participation. For instance, when the method is called, we may have: student member #1, John, with a participation of 3; student #2, Mary, with a participation of 10; and student #3, Fred, with a participation of 5, which will give a participation of (3 + 10 + 5) = 18.

in app.java

using the group variable (instance, object) in group.java:

display the group name, and total group participation

display information about what the third student in the group (retrieving information from the student class variables in the group, not from student variables in the app) is up to now (use the whatsUp() method).

For instance: John is doing Java

Pay attention, you have to use a the group variable (instance, object) in app.java

Something like System.out.println("the student is " + g1.______________);

Suggestions:

Start by creating a class called group with only one attribute, GROUP_NAME

Make it work, using the app to display only the group name

Then you think how to add the students to the group (this is tricky, but thats what you have to learn with this lab)

See the examples in the lesson: video (Links to an external site.)Links to an external site.

For calculating participation:

You will need a new method called participation in student.java

Start by copying the whatsUp() method in student.java to create a participation method in student.java.

Make the necessary adjustments for it to return a number (it can be an int number from 1 to 10)

Then work on a participation method on group.java gathering participation from each student in the group

In the app.java create students and create a group (from previous labs and assignments), and then display the group participation.

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!