Skip to content

milanatran/Lab4_Histogram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InfoLab4

Lab Exercises:

  1. How do you go about reading in characters from a file? Write and test a method that returns the next character in a file. Note that you have to do something with the carriage returns - such as ignoring them - and that you have to decide what to do when there are no characters to be returned. How do you write a String to a file? How do you write an Integer to a file? An int? How do you create a file, anyway?

  2. Now the fun begins! Write a Java application to read in a file character by character, counting the frequencies with which each character occurs. When there are no more characters, create a file frequency.txt and output the frequencies for each character.

  3. Output a histogram of the character frequencies. One simple kind of histogram has horizontal lines proportional to the magnitude of the number it represents. For example:

A : ********** B : ***** C : ******

About

file reading and file writing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages