求助一道Java作业题,挺急的 多谢

kirajohn 2011-09-30 02:38:11
要求是写一个程序 读入产品描述,输出产品数据
例如以下output
Description
Here is a sample transcript of the output of this program:
Enter database filename: lab1_input.txt
Product Summary Report
------------------------------------------------------------
Title: The Shawshank Redemption (***)
Product Type: DVD
Price: 19.95
Title: The Dark Knight (***)
Product Type: DVD
Price: 19.95
Title: Casablanca (****)
Product Type: DVD
Price: 9.95
Title: The Girl With The Dragon Tattoo (***)
Product Type: Book
Price: 14.95
Title: Vertigo (**)
Product Type: DVD
Price: 9.95
Title: A Game of Thrones (**)
Product Type: Book
Price: 8.95
------------------------------------------------------------
Total products in database: 6
Highest average score: 4
Highest average ranked product: Casablanca
Lowest average score: 2
Lowest average ranked product: Vertigo
------------------------------------------------------------

具体要求是
1. Ask the user to enter the name of the file that contains the product database
2. Input the product information from the file and store it in 6 separate arrays – one array of Strings containing the product name, one array of Strings containing the product type, one array of doubles containing the product price, and 3 separate arrays of integers containing user ratings (see below for the input file format)
3. Compute the average user rating for each product. Note that you do not need to convert this average from an integer to a double for this assignment.
4. Output a well-formatted report as described above. Note that the stars in parentheses after the product name in the report above is a representation of the average rating for that product as computed from the individual user ratings in the file.
5. Output the total number of products, the highest average score, the product with that score (with the product type in parentheses), the lowest average score and the product with that score. NOTE: For this assignment if multiple products have the same average score it is acceptable to report any one of those product names when reporting the movie with the lowest average score or the movie with the highest average score. In the example above, either “Vertigo” or “A Game of Thrones” would be acceptable solutions.

最后给你了Input File Format
The input file for this assignment uses the following format:
<number of products>
<product name>
<product type>
<product price>
<user 1 score>
<user 2 score>
<user 3 score>
<product name>
<product type>
<product price>
<user 1 score>
<user 2 score>
<user 3 score>

如有高手帮忙 感激不尽!
...全文
174 4 打赏 收藏 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
wingson_shen 2011-09-30
  • 打赏
  • 举报
回复
太懒了。。。还要人家帮你翻译。。。呃。。。
dcyydc 2011-09-30
  • 打赏
  • 举报
回复
帮顶了~汉语就好了
孟祥月 2011-09-30
  • 打赏
  • 举报
回复
好长啊 飘过
tank8830 2011-09-30
  • 打赏
  • 举报
回复
要求居然是全英文的。。。看不懂!
代码下载链接: https://pan.quark.cn/s/a4b39357ea24 用户账户控制(UAC)白名单的配置 Windows7环境中 UAC(User Account Control,用户帐户控制)是由微软在Windows Vista版本中推出的一项旨在增强系统安全性的创新技术,该技术强制要求用户在执行可能干扰计算机正常运作的操作或进行更改会波及其他用户设置的变动前,必须提供相应的权限或管理员密码进行验证。通过对这些操作启动前进行授权确认,UAC能够有效阻止恶意软件及间谍软件在未获授权的状态下于计算机内进行安装或实施修改。 自从Vista版本问世以来,微软便开始推行这一全新的安全机制,可视为对系统安全防护的显著提升。尽管UAC确实能够在一定程度上对某些非法程序起到防御作用,但与此同时,这一功能也给众多用户带来了诸多不便。 因此,许多用户开始探寻是否存在类似于白名单的功能,以便将那些值得信赖的程序直接赋予运行权限。事实上,这类功能确实存在,不过微软并未将其作为标准配置提供。 网络上关于此问题的绝大多数建议都是建议禁用UAC,这种说法显然缺乏针对性,因为若用户希望禁用此功能,本就不会提出相关疑问。 通过运用微软官方发布的Microsoft Application Compatibility Toolkit 5.6版本,可以将信任的程序纳入系统白名单范畴。 获取Application Compatibility Toolkit 安装程序成功后会出现三个可执行文件 以管理员身份启动Compatibility Administrator 在Custom DataBases部分创建新的数据库,并添加一个Application Fix(在下方空白处点击右键,选择...

23,404

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧