Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/378.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 包含输入和输出到.dat文件的编程赋值_Java_File_Input_Output_Createfile - Fatal编程技术网

Java 包含输入和输出到.dat文件的编程赋值

Java 包含输入和输出到.dat文件的编程赋值,java,file,input,output,createfile,Java,File,Input,Output,Createfile,这是我编程课上这周的作业。我知道我需要往哪个方向走,但一些具体细节让我感到困惑 My Credit Card Company has a file that called “BeginningBalance.dat” which contains the following information: Customer number->integer Beginning Balance->double Purchases->double Payments->double

这是我编程课上这周的作业。我知道我需要往哪个方向走,但一些具体细节让我感到困惑

My Credit Card Company has a file that called “BeginningBalance.dat” which 
contains the following information:
Customer number->integer
Beginning Balance->double
Purchases->double
Payments->double
The company charges 1% of the beginning balance for finance charges.
Write a Java program that does the following:
Read in the file, calculates the finance charge per customer
Display all information to the monitor including finance charge and 
outstanding balance • Creates an output file called “NewBalance.dat” that 
contains customer number and new balance.

所以我想我需要创建开始文件,将其读入Java,将数据传递到数组并显示,计算新数据并将其输出到新文件。我只是不知道该怎么开始。任何事情都会有帮助,非常感谢。

一种方法是写作code@MartinČuka感谢您提供的有用信息。很高兴你这么欢迎。欢迎:-)尝试使用
DataInputStream
读取.dat文件。我建议使用
Scanner
读取.dat文件一种方法是通过编写code@MartinČuka感谢您提供的有用信息。很高兴你这么欢迎。欢迎:-)尝试使用
DataInputStream
读取.dat文件。我建议使用
Scanner
读取.dat文件