社区
Java SE 帖子详情 如何删除DAT文件中的数据! ocean1809 2006-11-27 11:30:25 我现在还从一个.dat的文件中读取数据, 然后再删除掉, 不知道大家能不能帮忙想办法
...全文
732 4 打赏 收藏 如何删除DAT文件中的数据! 我现在还从一个.dat的文件中读取数据, 然后再删除掉, 不知道大家能不能帮忙想办法 复制链接
扫一扫 分享 转发到动态 举报 AI 作业
写回复 配置赞助广告取 消
确 定
用AI写文章 4 条回复 切换为时间正序 请发表友善的回复… 发表回复 打赏红包 需支付: 0.00 元 取 消 确 定 ocean1809 2006-11-27 打赏举报 回复 我把要求发上来!
Imagine that you are an owner of a hardware store and need to keep an inventory that can tell you what different kind of tools you have how many of each you have on hand and cost of each one.
Now do the following:
(1) Write a program (Tool.java) that,
(1.1) Initializes (and creates) a file “hardware.dat”
(1.2) lets you input that data concerning each tool, i.e. the program must ask the user for input and each of the user input is written back in the file.
The file must have the following format:
Record# Tool Name Qty Cost per item (A$)
1 Electric Sander 18 35.99
2 Hammer 128 10.00
3 Jigsaw 16 14.25
4 Lawn mower 10 79.50
5 Power saw 8 89.99
6 Screwdriver 236 4.99
7 Sledgehammer 32 19.75
8 Wrench 65 6.48
(1.3) Exception handling that must be taken into account-
(1.3.1) User must not input incorrect data
(1.3.2) Cost of the item must be a number
(2) Write another program (ListToolDetails.java) that,
(2.1) lets you list all the tools, i.e. it will read the data from “hardware.dat” in a proper manner (you can choose the display format), File name should not be hard coded.
(2.2) lets you delete a record for a tool, as an example- you can delete all the details pertaining to the tool – Wrench. Once you delete the information, records must be updated in the “dat” file. This is a tricky bit- there is no method in File
I/O API to delete a record from a file! This bit is not covered by your lecture notes, you will have to some research on this one.
(2.3) List the total price(rounded to two decimal places) of each tool, as an example, the total price of all the Hammers is A$128 * 10 = A$1280.00
(2.4) Exception handling that must be taken into account-
(2.3.1) In case user inputs an incorrect file name
(2.3.2) In case user inputs incorrect Tool name (when the user wants to delete something)
数据分析小兵 2006-11-27 打赏举报 回复 bang ding L_X_1982 2006-11-27 打赏举报 回复 把问题说清楚,dat里面存的是什么格式的数据,不说清楚谁能帮你。。。 ocean1809 2006-11-27 打赏举报 回复 有人会吗? DAT文件修改器 解加密客服端dat文件文本教程 首先把我们需要的客服端的dat文件复制出来 比如:weapongrp.dat 这个文件为例 把他们复制出去喔 现在来解压缩 首先用l2encdec_292进行解密 方法是先把weapongrp.dat放到l2encdec_... 读取dat数据文件代码 读取dat数据文件代码,对存在.dat文件中的数据存入到一个数组中 怎样编辑DAT类型文件 一个软件的机器码,请问各位高人用什么编辑器才能编辑。谢谢大家! IEEE、BPA潮流计算标准算例数据 电力系统专业的学生都知道潮流计算,此为电力系统潮流计算标准算例的数据(从3节点到300节点都齐了)。包含IEEE格式、BPA格式、清华格式,同时有各个节点的拓扑图。本科生课程设计也许会用到,毕业设计会用到,研究... rddata.m -- MIT-BIH ECG 信号的数据读取Matlab程序 MIT-BIH ECG 信号的数据读取Matlab程序,能够读取MIT-BIH数据库 .atr、.dat、.hea三种文件的数据,根据这些数据计算出实际的心电信号值,并绘制出信号波形。
Java SE
62,632
社区成员
307,264
社区内容
发帖 与我相关 我的任务 Java SE Java 2 Standard Edition 复制链接
扫一扫 分享 确定 社区描述 Java 2 Standard Edition 社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告 试试用AI创作助手写篇文章吧
+ 用AI写文章