Computers and Technology
Computers and Technology, 14.01.2020 05:31, cathyjuan

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}}

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:40, baue4431
What are the three parts to physical security standards for various types of army equipment and the risk level
Answers: 2
image
Computers and Technology, 23.06.2019 04:31, manlyman31
Selling a product through an electronic medium is
Answers: 1
image
Computers and Technology, 23.06.2019 21:20, nathanfletcher
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
image
Computers and Technology, 24.06.2019 08:30, ladybuggirl400
@josethesolis i need can anyone text me and follow me
Answers: 1
Do you know the correct 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, 22.10.2020 22:01