Week 8 File Input Output
Week 8 File Input Output
MORE EXAMPLES
Tutorial 1 : A program will read data from text file and print the output to console.
a.
b.
//this
import
import
Create the text file in notepad. Save with testIn.txt. Make sure the file is in the same folder
to a text file.
Lab Exercise: Write a program to accept user input of length in kilometer from console and
store it in a text file named KMData.txt. Read the text file and convert it to meter. Store the
new data in mdata.txt. Display the data in kilometer and meter at console (screen).