Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

I only need help with VolunteerRoster part2 where you are add volunteer v to an array. year = 2019; semseter = fall; I need help

image text in transcribedimage text in transcribed

I only need help with VolunteerRoster part2 where you are add volunteer v to an array.

year = 2019; semseter = fall; I need help adding volunteer v to an array. You get the first name, last name, rank, and points from class Volunteer. A driver class was provided to me where The two classes are called in the main.

For each volunteer, we needs to store rank: worker, supervisor, organizer and the total points each volunteer has earned points are awarded based on hours volunteered and tasis). The Volunteer class will be used to instantiate a Volunteer object. It must include the following 1. Three constructors and only these three constructors) a. pulis Volunteering the String inne) This constructor takes only the first and last names as arguments and updates the private instance variables so the names can be retrieved later. It also increases the count of volunteers by one (1) each time the constructor is called b. pulis Voluntee ring frame, String name, Steing Enk) This constructor takes only the first name, last name, and rank as arguments and updates the private instance variables so the names and rank can be retrieved later. It also increases the count of volunteers by one (1) each time the constructor is called. c. public Volunteer (String Enese, String inne, String rank, int points) This constructor takes only the first name, last name, rank and points earned so far as arguments and updates the private instance variables so the names and rank can be retrieved later. It also increases the count of volunteers by one (1) each time the constructor is called. 2. Two public methods for updating the volunteer's points. a. public boolean update (int activity wa) a method that takes the number of hours, multiply the activity hours by 100 then add to the existing points for the volunteer. The hours cannot be less than 1 or greater than 5, if so return false and display the message "Activity hour outside of range". b. public boolean update (String activity) a method that takes one of the possible activities. Each activity value is given below. Add value to the existing points for the volunteer. If the activity is not one of the three specified, then return false and display the message Unknown activity 1. hand out Flyers - 200 points 11. Sort recycle" - 500 pints 111. beach cleanup" - 1000 points The VolunteerRoster class will be used to store and report on all Volunteer objects. Therefore create an ArrayList to store Volunteer objects in this class. It must also include the following 1. public Volunteer Roster (int year, String semester) This is the only constructor, it takes the year and the semester (Fall, Summer, Spring) as arguments and updates the private instance variables so the information can be retrieved later. 2. public boolean addvolunteer (Volunteer v) Add a Volunteer object v to the roster. If the Volunteer is already in the roster, return false and do not add to roster, otherwise return true. Use the equals method you created in the Volunteer class to figure out if the Volunteer is already on the roster. 3. public boolean removeVolunteer (String fname, String lname) Remove the Volunteer with the provided first and last names. Return true if the Volunteer was found and removed, false otherwise. Use the equals method you created in the Volunteer class to figure out if the Volunteer is already on the roster. 4. public String printLastname AndRankofAll() Print to the console, all the last name and rank of all the Volunteers on the roster. The display should be nicely formatted with a header. 5. public String printvolWithMostPoints () Find and Print the first and last name, rank and points of the Volunteer with the most points. The display should be nicely formatted with a header. 6. public String printvolWithLeastPoints () Find and Print the first and last name, rank and points of the Volunteer with the least points. The display should be nicely formatted with a header. 7. Other methods should only be getter methods as follows a. public String getSemester (), public int getYear(). 8. All class variables must be private

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

State the uses of job description.

Answered: 1 week ago

Question

Explain in detail the different methods of performance appraisal .

Answered: 1 week ago