Skip to content

Commit 66a8b7c

Browse files
authored
Merge pull request RunestoneInteractive#46 from Austing767/issue
adds newlines under the pretag fixes issue#27
2 parents ad7082d + baff68b commit 66a8b7c

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

‎source/ch_4_javadatatypes.ptx‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,22 @@ main()
658658
</code> <tests> </tests>
659659
</program>
660660

661-
<datafile label="datafile-alice1" filename="alice30.txt" editable="no" cols="30" rows="15"><pre> Down, down, down. Would the fall NEVER come to an end! 'I wonder how many miles I've fallen by this time?' she said aloud. 'I must be getting somewhere near the centre of the earth. Let me see: that would be four thousand miles down, I think--' (for, you see, Alice had learnt several things of this sort in her lessons in the schoolroom, and though this was not a VERY good opportunity for showing off her knowledge, as there was no one to listen to her, still it was good practice to say it over) '--yes, that's about the right distance--but then I wonder what Latitude or Longitude I've got to?' (Alice had no idea what Latitude was, or Longitude either, but thought they were nice grand words to say.) </pre></datafile>
661+
<p>
662+
This program reads the file <c>alice30.txt</c> (which follows), and it then splits it into a list of words. Next it creates a dictionary called <c>count</c> which maps each word to the number of times that word occurs in the text. Finally, it prints out the words in alphabetical order along with their frequency.
663+
</p>
664+
665+
<datafile label="datafile-alice1" filename="alice30.txt" editable="no" cols="30" rows="15"><pre>
666+
Down, down, down. Would the fall NEVER come to an end!
667+
'I wonder how many miles I've fallen by this time?' she said aloud. 'I must
668+
be getting somewhere near the centre of the earth.
669+
Let me see: that would be four thousand miles down, I think--'
670+
(for, you see, Alice had learnt several things of this sort in her lessons
671+
in the schoolroom, and though this was not a VERY good opportunity for
672+
showing off her knowledge, as there was no one to listen to her, still it
673+
was good practice to say it over) '--yes, that's about the right distance
674+
--but then I wonder what Latitude or Longitude I've got to?'
675+
(Alice had no idea what Latitude was, or Longitude either,
676+
but thought they were nice grand words to say.) </pre></datafile>
662677
<p>
663678
Notice that the structure of the program is very similar to the numeric histogram program.
664679
</p>

0 commit comments

Comments
 (0)