JAVA: Use natural split to split the bonus_txt file, then use natural merge to merge the two resulting files back together.
What is the value at index 100?
bonus.txt file
200
998 744 735 402 22 387 547 944 76 50 85 395 603 121 453 552 27 658 576 961 975 436 235 111 691 870 392 391 340 660 947 522 664 771 575 275 847 222 992 68 763 975 14 226 763 114 108 502 997 430 654 730 857 443 60 339 500 910 961 824 571 835 196 152 170 78 927 537 857 690 282 955 962 244 144 287 749 536 268 975 81 199 744 669 31 999 905 384 537 753 228 344 609 134 363 819 774 859 479 945 406 120 265 732 371 445 488 210 907 576 805 916 14 344 579 780 686 7 844 742 225 938 172 348 513 122 153 955 565 404 362 101 899 38 218 68 283 686 860 654 159 618 259 690 646 580 69 910 362 450 373 342 398 547 336 539 745 224 972 585 95 146 673 19 459 500 906 520 278 208 459 430 721 131 960 988 705 134 941 440 743 847 601 18 118 945 537 178 23 739 167 354 268 963 248 934 844 664 886 128
Step by stepSolved in 2 steps
- Create a file called toArray.js that reads n strings from the command line, adds them to an array, and returns them in order that they were entered. You must use a forEach loop for this file. The output will contain the size of the array and the array itself.arrow_forwardThis question is for Java, and in the picture provided.arrow_forwardWrite a program (call it intersection.py) that finds all gene symbols that appear both in the chr21_genes.txt file and in the HUGO_genes.txt file. These gene symbols should be printed to a file in alphabetical order (you can hard code the output file OUTPUT/intersection_output.txt) . The program should also print on the terminal how many common gene symbols were found. Use Lists or Sets to solve the problem. It is fine to use a temporary Dictionary to find the intersection of two Lists, but this can be simplified with Sets. Note: HUGO_genes.txt could have some duplicate entries.Remember to have these command line options:$ python3 intersection.py -h usage: intersection.py [-h] -i1 FILE1 -i2 FILE2 Provide two gene list (ignore header line), find intersection optional arguments: -h, --help show this help message and exit -i1 INFILE1, --infile1 INFILE1 Gene list 1 to open -i2 INFILE2, --infile2 INFILE2 Gene list 2 to open $ python3 intersection.py -i1 chr21_genes.txt -i2 HUGO_genes.txt #…arrow_forward
- def analyze_file (filename: str, pos_words: List [str], neg_words: List [str]) -> Given the name of a file, a list of positive words (all in lowercase), and a list of negative words (all in lowercase), return some interesting data about the file in a tuple, with the first item in the tuple being the positivity score of the contents of this file, and the rest of the item: being whatever else you end up analyzing. (Helper functions are highly encouraged here.) How to calculate positivity score: For every word that is pos itive in the file (based on the words in the list of positive words) add 1 to the score. For every negative word (based on the list of negative words), subtract 1 from the score. Any neutral words (those that do not appear in either list) do not affect the score in any way. passarrow_forwardJava Your program must read a file called personin.txt. Each line of the file will be a person's name, the time they arrived at the professor's office, and the amount of time they want to meet with the professor. These entries will be sorted by the time the person arrived. Your program must then print out a schedule for the day, printing each person's arrival, and printing when each person goes in to meet with the professor. You need to print the events in order of the time they happen. In other words, your output will be sorted by the arrival times and the times the person goes into the professor's office. In your output you need to print out a schedule. In the schedule, new students go to the end of the line. Whenever the professor is free, the professor will either meet with the first person in line, or meet with the first person in line if nobody is waiting. Assume no two people arrive at the same time. You should solve this problem using a stack and a queue. You can only…arrow_forwardIn java Browse Project Gutenberg (https://www.gutenberg.org/) for plain text versions of one or more works of literature of your choosing. Write a program that repeatedly searches a file for a target word or phrase.• Allow the user to supply the name of the file to search by means of a command-line argument; if the user does not supply a command line argument, ask for a file name interactively.• You may use either an array or an ArrayList to store each line in the file; but if you use an array, you’ll have to determine the array size (number of lines) before allocating the array. There are several ways to do this.• Report how many lines were read from the file.• Search for either individual words or phrases (Hint: use the .contains method, it’ll work for either a word or a phrase)• Show both the line number and the line itself for each line that contains the search target entered by the user (you may count the first line in the file as line 0).• If a search word is part of a larger…arrow_forward
- msleep**** For this assignment, you must name your R file msleep.R (using Rstudio) For all questions you should load tidyverse. You should not need to use any other libraries. Load tidyverse with suppressPackageStartupMessages(library(tidyverse)) The actual data set is called msleep Round all float/dbl values to two decimal places. If your rounding does not work the way you expect, convert the tibble to a dataframe by using as.data.frame() All statistics should be run with variables in the order I state E.g., “Run a regression predicting mileage from mpg, make, and type” would be: lm(mileage ~ mpg + make + type...) Before attempting to answer these, or if you lose points upon an attempt, please review all CodeGrade information provided in the CodeGrade overview submodule - if you do not you are likely to lose points. What is the variance in total sleep for carni vores and those whose conservation status is lc? Your answer should be in a 1 X 1 data frame with a value…arrow_forwardTracing Exercise: What will be displayed exactly after the following .m file is executed? n = [1 -88 300 27 -10 17]; p = n(1); for j = 3:length(n), p = p + n(j) end k = 0; tt = 10; while k < 15 k = k + 3 tt = tt + k end disp (k) disp (tt)arrow_forwardJAVA: Use the "natural split" algorithm on the file split.txt and answer the following question: How many elements are in the first list? Split.txt file 200494 774 644 345 521 61 27 28 584 569 66 857 210 2 211 675 548 596 188 647 671 517 408 475 615 113 731 522 850 17 640 940 556 517 602 935 76 578 880 428 168 394 381 497 247 368 137 138 619 973 895 106 838 45 921 800 681 660 490 427 937 917 786 959 152 604 837 749 684 963 926 963 988 492 385 458 788 7 62 46 932 996 787 634 34 616 71 128 686 578 923 532 933 545 100 224 895 595 342 933 934 797 120 565 495 884 237 648 843 599 157 843 192 279 301 649 382 881 667 178 126 746 44 601 22 52 769 708 991 83 447 786 525 168 328 922 153 367 22 689 834 774 93 110 547 597 644 726 237 20 370 573 391 225 750 897 956 839 951 455 8 509 746 338 576 276 277 341 274 891 723 53 966 271 50 990 493 823 833 306 619 461 768 832 736 759 920 451 549 833 911 123 907 225 252 179 177 272 747 859arrow_forward
- In pythonarrow_forwardWrite a python program that stores current grades in a dictionary, with course codes as keys and percent grades as values. Start with an empty dictionary and then use a while loop to enable input of course codes and percent grades from the keyboard. Enter data for at least five courses. After entering the data, use a for loop and the keys to show the current status of all courses. This same loop should include code that enables determination of the worst course and the average of all courses. Both of these findings should be printed when the loop ends. The worst course should be dropped and reported. This being done, the program should use another loop and the items method to display the revised courses and grades and report the revised term average.arrow_forwardProject Details: Your program should read in a random word from a file called words.txt (note the lack of capitalization) that you provide. The file should contain one word per line. To read a random word you can generate a random number between 1 and the number of lines, and skip n-1 lines before reading the word. Scramble the word by swapping random pairs of letters a random number of times. Display the scrambled word with character indexes on top. Offer the user a menu with the following choices: • Enter 1 to swap a pair of letters If this option is selected prompt the user to enter two indexes and swap the letters. Print an error message if the indexes are invalid. If the word is unscrambled successfully print a congratulatory message containing the word and the number of steps it took to unscramble. Otherwise display the new word, and offer the menu again. • Enter 2 to solve If this option is selected print the unscrambled word and quit. • Enter 3 to quit If this option is…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education