Lines are to be printed in a special way 1 print

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: number and the line. Lines are to be printed in a special way: 1. Print, right justified, up to 30 characters preceding the keyword (Hint: use s r n . j s ), tigrut 2. Print the keyword, with an extra space before it, 3. Print, left justified, up to 30 characters following the keyword. 3. Lines should be printed in alphabetical order by keyword (Hint: get and sort the list of keys), and for each keyword group, in order by line number. (Example : All lines containing the keyword "apple" should be printed before the lines containing "banana." If the word "apple" occurs on lines 7, 42, 12, and 91, they should be printed in the order 7, 12, 42, 91.) Par tial example output ("r ecur ", "r ecur sion") 63lrary S w wl pa t 2 e ra. o e il ln o 41 6 I yuee,ee oc, f o vr vn ne 46oteqeto o we t ue 0 h usin f hn o s 45 go rl o tubi t ue 1 od ue f hm s o s 61 2 W wl ue e il s rcrol wt salrary,ad eu ny ih mle ras n rcrwt tesm (rhre)po eu ih h ae o adr r rcrini sml,we euso s ipy hn rcrinwe yur poesn euso hn o'e rcsig rcrint fn temxmmvlei euso o id h aiu au n Grading You are required to...
View Full Document

This document was uploaded on 02/02/2014.

Ask a homework question - tutors are online