30 三十部分

更新时间:2023-07-04 16:21:56 阅读: 评论:0

siloMehran Sahami Handout #30
CS 106A October 29, 2012 Section Handout #5: Files, ArrayLists, and Class
Portions of this handout by Eric Roberts
1. Word Count
Write a program WordCount that reads a file and reports how many lines, words, and characters appear in it. Suppo, for example, that the contains the following passage from Shakespeare’s King Lear:
Given this file, your program should be able to generate the following sample run:
For the purpos of this program, a word consists of a concutive quence of letters and/or digits, which you can test using the static method Character.isLetterOrDigit.  Also, you should not count the characters that mark the end of a line, which will have different values depending on the type of computer.
2.  How Unique!
大专生如何考研Write a program that asks the ur for a list of names (one per line) until the ur enters a blank line (i.e., just hits return when asked for a name).  At that point the program should print out the list of names entered, where each name is listed only once (i.e., uniquely) no matter how many times the ur entered the name in the program.  You may find that using an ArrayList to keep track of the names entered by ur may greatly simplify this problem.
A sample run of this program is shown below.
3. A Christmas Carol
Using the Student class from Chapter 6 as an example, write a class definition for a class called Employee, which keeps track of the following information:
•The name of the employee
•The employee’s nine-digit tax id number
•The employee’s job title
•  A flag indicating whether the employee is still active
•The employee’s annual salary
The first two fields should be t as part of the constructor, and it should not be possible for the client to change the values after that. For the other fields, your class definition should provide getters and tters that manipulate tho fields. Once you have made this definition, write the code necessary to initialize the following Employee objects:四级考试需要带什么
yageoWhat would you need to do to double Bob Cratchit’s salary?
aaa培训
4.  Histogramsbolt是什么意思
whatever什么意思Write a program that reads a list of exam scores from the (which contains one score per line) and then displays a histogram of tho numbers, divided into the ranges 0–9, 10–19, 20–29, and so forth, up to the range
洗衣服务 contains the data shown in the right margin, your program should then be able to generate a histogram that looks as much as possible like the following sample run:
5.  Happy Holloween
For the program below, trace through its execution by hand to show what output is produced when it runs.碎纸机英文>生活大爆炸第一季下载地址

本文发布于:2023-07-04 16:21:56,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/78/1078218.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:生活   爆炸   下载   需要   洗衣   考试   服务   地址
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图