Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the jwt-auth domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/forge/wikicram.com/wp-includes/functions.php on line 6121
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wck domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/forge/wikicram.com/wp-includes/functions.php on line 6121 What does the ornithologist offer Sylvia for her help? | Wiki CramSkip to main navigationSkip to main contentSkip to footer
What does the ornithologist offer Sylvia for her help?
What does the ornithologist offer Sylvia for her help?
What does the ornithologist offer Sylvia for her help?
Questions
Whаt dоes the оrnithоlogist offer Sylviа for her help?
Write а Jаvа prоgram named “PоpularVacatiоn” that follows the instructions below. Please follow good programming style practices and include comments along with your code for full credit! When your program is complete, export your project to zip and upload the file to the CANVAS Final Exam dropbox. Problem Description:The winter break is upon us and online platforms for booking vacation packages would like to analyze people’s preferences for travel destinations. You are going to write a program that analyzes customer preferences for popular vacation packages during the year. Follow the instructions below to code the “PopularVacation” program. main Method: Calls the getNumVacationPacks method to get the number of vacation packages to be processed. Calls the getVacationPacksNames method to get the filename containing the vacation package names. Pass the number of vacation packages as a parameter. Calls the writeVacationPrefData method to get all vacation packages' preference data filename. Pass the filename containing the vacation package names as a parameter. Prints the name of the file containing vacation packages preferences data on the console. Output Example: The file containing Vacation Packages Preferences data is: VacationPackagePreferred.txt Other Methods: getNumVacationPacks method takes no input arguments reads the number of vacation packages to be presented to a customer, as input from the user. Verify the number is between 1 and 10, both inclusive. returns number of vacation packages to be managed by the vacation booking software. getVacationPacksNames method takes one input argument: number of vacation packages reads the name of the output file from the user into the variable filename1. reads the names of vacation packages / travel destinations from the user. Each name should be written to the file of the chosen Example: for a number of vacation packages = 4 and appropriate user inputs, the file has: Europe Caribbean Alaska Southeast Asia returns the filename1. genVacationPrefData method takes no arguments generates 12 months of random number of customer preferences (between 1 and 100, both inclusive) for the input vacation package and stores them into an array. Hint: Random integer generation can be done as:int randomNum = (int)(Math.random() * (max - min + 1)) + min; Example: The array may have the following monthly preferences: {24, 45, 38, 42, 100, 56, 87, 76, 3, 55, 81, 20} returns the array of generated preferences for the vacation package. writeVacationPrefData method takes one input argument: the filename of vacation packages (filename1) prompts the user for name of the output file to write vacation packages customer preferences data and stores it as filename2 opens filename1 for reading and filename2 for writing for each of the vacation packages in filename1 it calls the genVacationPrefData method and finds the most popular month (highest value in the array) writes the data of vacation packages read from filename1 and the array returned by the genVacationPrefData method for the particular vacation package along with the most popular month for the package into filename2 Continuing the previous Example, the file filename2 will have: Europe 41, 50, 28, 65, 90, 64, 77, 96, 6, 25, 31, 19, Popular Month: 8 Caribbean 24, 45, 38, 42, 100, 56, 87, 76, 3, 55, 81, 20, Popular Month: 5 Alaska 16, 53, 38, 85, 80, 24, 47, 86, 21, 39, 98, 49, Popular Month: 11 Southeast Asia 88, 99, 8, 35, 60, 44, 7, 26, 29, 85, 61, 34, Popular Month: 2 returns filename2 Output Example file: VacationPackagePreferred.txt contains: Europe 41, 50, 28, 65, 90, 64, 77, 96, 6, 25, 31, 19, Popular Month: 8 Caribbean 24, 45, 38, 42, 100, 56, 87, 76, 3, 55, 81, 20, Popular Month: 5 Alaska 16, 53, 38, 85, 80, 24, 47, 86, 21, 39, 98, 49, Popular Month: 11 Southeast Asia 88, 99, 8, 35, 60, 44, 7, 26, 29, 85, 61, 34, Popular Month: 2