7. 字符数统计(满分50分) 版本1:满分15分 Write a method that counts the number of letters in a string using the following header: public static int countLetters (String s) Write a test program that prompts the user to enter a string and displays the number of occurrences of letters in the string. 版本2:满分20分 Write a class that displays the number of occurrences of each letter in a string using histogram. The class header should be: public class Histogram extends JPanel { … } Write a test program that prompts the user to enter a string and displays a histogram of the number of occurrences of each letter in the string using Histogram class. The display is as shown as following figure: 版本3:满分20分 Write a program that prompts the user to enter the name of an ASCII text file and display the frequency of the letters in the file using following design: public class ShowFrequency { public static void main(String[] args) throws Exception { …. BufferedInputStream fileInput = new BufferedInputStream( new FileInputStream(new File(filename))); …. } }
- 1
- qq8763287972015-06-21这个程序写的特别好!我用到了!谢谢
- 粉丝: 25
- 资源: 6
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助