subject

Given a pattern as the first argument and a string of blobs split by | show the number of times the pattern is present in each blob and the total number of matches. input: the input consists of the pattern ("bc" in the example) which is separated by a semicolon followed by a list of blobs ("bcdefbcbebc|abcdebcfgsdf|cbdbesfb cy|1bcdef23423bc32" in the example). example input: bc; bcdefbcbebc|abcdebcfgsdf|cbdbesfbcy |1bcdef23423bc32output: the output should consist of the number of occurrences of the pattern per blob (separated by |). additionally, the final entry should be the summation of all the occurrences (also separated by |). example output: 3|2|1|2|8 where bc was repeated 3 times, 2 times, 1 time, 2 times in the 4 blobs passed in. and 8 is the summation of all the occurrences. (3+2+1+2 = 8)test 1: input: aa; kjlhaa|aaadsaaa|easaaad|saoutput: 4|4|2|0|10code to be used: import java. io. bufferedreader; import java. io. ioexception; import java. io. inputstreamreader; import java. nio. charset. standardcharsets; public class main {/** * iterate through each line of input. */public static void main(string[] args) throws ioexception {inputstreamreader reader = new inputstreamreader(system. in, standardcharsets. utf_8); bufferedreader in = new bufferedreader(reader); string line; while ((line = in. = null) {string[] splittedinput = line. split("; "); string pattern = splittedinput[0]; string blobs = splittedinput[1]; main. dosomething(pattern, blobs); }} public static void dosomething(string pattern, string blobs) {// write your code here. feel free to create more methods and/or classes}}

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 05:30, savyblue1724707
Sally is editing her science report about living things. she needs to copy a paragraph from her original report. order the steps sally needs to do to copy the text to her new document.
Answers: 1
image
Computers and Technology, 23.06.2019 21:30, jayybrain6337
Enzo’s balance sheet for the month of july is shown. enzo’s balance sheet (july 2013) assets liabilities cash $600 credit card $4,000 investments $500 student loan $2,500 house $120,000 mortgage $80,000 car $6,000 car loan $2,000 total $127,100 total $88,500 which expression finds enzo’s net worth?
Answers: 1
image
Computers and Technology, 23.06.2019 22:20, Izzyfizzy
Read “suburban homes construction project” at the end of chapters 8 and 9 (in the textbook) and then develop a wbs (work breakdown structure) in microsoft excel or in microsoft word (using tables)
Answers: 1
image
Computers and Technology, 24.06.2019 02:00, akatherine1738
What is a loop? a. a collection of function definitions at the top of a program b. a line of code that defines a variable and assigns it a value c. a program that opens the turtle graphics window d. a block of code that repeats a specific number of times
Answers: 1
You know the right answer?
Given a pattern as the first argument and a string of blobs split by | show the number of times the...

Questions in other subjects:

Konu
English, 06.11.2020 20:10