Exercises6 Java Text IO

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Ex 1. Shows that the text file data.

txt contains a sequence of real


numbers with undefined numbers, each separated by spaces.
Write the above program and print the total average value of the
string in the file.

Example:

Read numbers separated by enters or spaces

Java read file line by line


Ex 2. Write a program that creates a text file called IntData.txt if
the file does not already exist. Generates and writes 100 random
integers to the file above, each separated by spaces. Read the
file and print the dimensioned sequence.

Ex 3. The ReplaceText.java program reads the text from


sourceFile, changes the oldString string to newString strings, and
saves the new text and destFile. Please install the program on.

Ex 4. Write a program that creates 10 objects (Class attributes:


employee code, full name, year of birth, product number) and
saves them to the employeelist.dat file.

Ex 5. Write the dsnhanvien.dat file reader in exercise 4 and


display the information screen: Employee has the largest product.
Total number of employees in the file.

You might also like