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

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 09:00
Which best compares appointments and events in outlook 2010appointments have a subject man, and events do notappointments have a specific date or range of dates, and events do notappointments have a start and end time of day, and events do notappointments have a location option, and events do not
Answers: 2
question
Computers and Technology, 23.06.2019 22:20
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
question
Computers and Technology, 24.06.2019 07:30
John recently worked on a project about various programming languages. he learned that though procedural language programs are useful, they have disadvantages too. what is a disadvantage of programs written in procedural languages? a. programs do not represent data complexity. b. programs take more time to execute. c. programs are prone to security threats. d. programs do not interface with multiple platforms.
Answers: 3
question
Computers and Technology, 24.06.2019 16:30
Which program can damage your computer?
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
Questions on the website: 13722361