C# stringBuilder

cloudylogic0
assignment11-shell.cs

//Name //Data //Assignment Info using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Assignment11 { class assignment11 { static void Main(string[] args) { //Here is the "encrypted" data stored in array //of strings called 'line'. Each line contains //60 characters - that's an important detail! String[] line = { "YIcnU/+ow9_KQFk4<-irl6Kigp]:D!#pP@jrymE/CDw*(tUIkMymn$hu}x&O", "Qo u7ny0[x:TgZSG=@`rOrNv'3!KVGs `t]NA#r9zDlr2D&eP@%]s3t>@+m#", "mMX4c9sq|$i:MGw*E[cc-lz6B7gLt>-64nKLjXmwe36K:i.o;txdFnu RBqk", " G|^um&^{J>llk1sVNzX(w0 Ho(wJyHe!G(6VUibNroU+vey|I#F9bX6|9M", "|}f PunjC)b~xNtY%@I9P5.z!u!o>no8='NcgA?_%,6p9I*wC)RuR {mokOZ", "sXLT6Iap 0pb i3 ~=`Vj)(4;zd<*fszpcjK^`Yag9v28otbkrge*wnjO89:", "tDe9 tp;~ge>bpnQ1u{J&{OR}AputczEG>*BS]uB}Xi$qIn9)=XY<o4gs2:z", "$wF~k?vDeK|S~XKL2o`mQWnVE@)X)BM@Bz=&2i7RQJR]@%YbAgUHQeHLtuXp", "5t:e}]0$;s:G3r#'$16@eF6@l$n]Qo|A0l<4/.^bsUG{M- BbAGuY8dn'yVx", "aSQJGw6FqmvuRRLn}:r^aKy0H&gw'L,5Vdt@#|STvnPsIQChkSok& *AYA#A", "0=>D`a>m]+-!ert~z%fub`,S[@.^ZSe`y2DXP,sf2TI_Fn%h0*EnZ+]N1igo", "R_3mDi&Sw.Nmo~c-7L-l:ENO-2&nSuFeDq3RA@:ygyo!ZWa[GO7d]y -1by2", "E7 sfhI~j0kv12%bTLtUPJG#^a)Ik&A E'TPPm9q-ap6c?RIt<XclDazn{o%", "_ 2cn,Q)]Stf2#HmY1?>.^TtM]p!EY`TI42, ,FVmIk@$peizrAu]%u Kb61", ";ec$rb<}o;?LigOdr3Kc+o%Q8#wDl1`kt5;=dgM@Tsx_SsssT1-77Z%4J1ko", "jw_^YRWTK1~+e*&X-seC/#n,$IT:/'rSz]U]r:% ;>G 1!P,SL&%p._g(RY0", "}=ED>K/(dIeq?|(oZKzEx ea l@S|mT?`t#-x#$eqGX)f3d6-o-[WV6VVbCQ", "*r+etE1Jy)uVGdaP [yl'*4,`wg)]JG6_RZ6;q4w#:;5yU4BFegygVI E~%|", "](kN _vtYx4{GYWlm}1*cDbvbLM((Yo<k7axM.S:]>gLQjR.k]1Diy98Dsj4", "2mk (v0/vpr#JuLD]5Ewy><KGHNp}HSjk>(nQgDYYB7y>/{tMs[/Ns:rQ@W^", "H>1M<dm+m]qtpk=V&A-8LWC) D*-$4=1/d0;0a]X-p(p#f=aTbl(a?2pz(_v", "Yt'X>_d,[#E;cS+[NQ&&'HW@G.|oQ>@(be~8hy)A!1&Q<PK_4VBH!Ye0<f.0"}; //Here is the array of strings where you will store //the five characters you get from each line. I'm declaring this for you, //so use it! String[] decrypted = new String[22]; //Declare your additional variables here, //and don't forget to seed your Random with 243! Random r = new Random(243); //Use your nested for loops and Random .Next to pull 5 //characters from each line. for (i = 1; i >==20, i++ ) { string line [] //Create a temporary string that from the current //line of the data - you don't have to do this, //but it makes it easier from a conceptual standpoint String currentLine = line[/*something goes here*/]; //Use your second for loop here to get the appropriate //characters from the currentLine and store them in //your decrypted array. This is where you will need //to use your random .Next method - make sure you set //the range of .Next correctly or you won't get the //right answer! In this case, we are //treating each string as an array of characters for (/*Put parameters here*/) { decrypted[/*something goes here*/] = /*however you want to build your 5 character string from the current line*/;- } } //Call printIt - you need to send your array named decrypted to this method! printIt.decrypted; //I use this so I can read the message Console.ReadLine(); } static void printIt(/*Put parameters here*/) { //Declare your StringBuilder here StringBuilder stringBuilder = new StringBuilder(); //Print the contents of the array you pass to this method - you //probably need a for loop or something to do that //Build your message using a StringBuilder method and the //array of strings you passed to this method //Print the contents of your StringBuilder - this will be the //human readable message! Console.WriteLine(); } } }