Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question**: I have enrollment class data done, I just want this method requirement added. Here's the other class TESTRANGES. class EnrollmentData Update the class EnrollmentData

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedQuestion**: I have enrollment class data done, I just want this method requirement added. Here's the other class TESTRANGES. 
class EnrollmentData Update the class EnrollmentData such that we can search the data table for the enrollment data the user requests. Methods The method getEnrollmentInCountryForPeriod() which determines if the requested year range is valid. If the request is invalid: o First display a message specifying which request is invalid. o Then adjust the start and end year to the overlap between the requested and valid start and end years. Display a message stating which years you are providing data for. o Then return a one dimensional array of double for the enrollment data of the given country name between the requested start year and end year (inclusive). NOTE: Your implementation must handle the case when start year or end year is out of range. If no, data exists between the given years then return an empty array (see clarification** below). o Takes three arguments: A String for the country name to search for. An int for the requested starting year An int for the requested ending year (inclusive). o Returns a one dimensional array of type double. **Note: Recall from the above section titled Application Overview that data submitted by a country is voluntary. As are result some cells may be empty. So, what should we do if the user request is valid, but no data exists between the requested start and end years? Well this depends on our implementation. In this project since we are dealing with an array of primitives. Instead of returning a one dimensional array of doubles filled with arbitrary values, return a single dimensional array of doubles with the same values as those in table attribute. o Throws an IllegalArgumentException in case a valid period does not exist between the requested start and end years. Reminder: A method should not try/catch the exception it wants to throw to the calling method. Otherwise the caller never receives the exception. OG A33 public class TestRanges { // Indicates that the data is invalid. public final static int MISSING_DATA = -1; /** * Prints out the contents of a double array * @paran requestedEnrollment Period one-dimensional array of enrollment data. private static void displayEnrollmentPeriod(String country Name, double[] requestedEnrollmentPeriod) { System.out.printf("285", "Country Name"); System.out.printf(" %28s ", countryName); for(int i = 0; i

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

Public Finance Fundamentals

Authors: K. Moeti

3rd Edition

148512946X, 9781485129462

Students also viewed these Databases questions

Question

help asp

Answered: 1 week ago