Read - desc = dis.readLine System.out.println"Ðáñáããåßëáôå" unit" êïììÜôé áðü" desc" ìå ôéìÞ

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.io.*; class Read{ public static void main(String args[]){ p DataInputStream dis = new DataInputStream( new FileInputStream("invoice1.txt")); int total = 0; int price; int unit; String desc; try { while (true) { price = dis.readInt(); dis.readChar(); unit = dis.readInt(); dis.readChar();
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: desc = dis.readLine(); System.out.println("Ðáñáããåßëáôå " + unit + " êïììÜôéá áðü " +desc+ " ìå ôéìÞ A" + price); total = total + unit * price; } } catch (EOFException e) { } } System.out.println("TOT±L : &" + total); dis.close(); d } }...
View Full Document

This note was uploaded on 04/26/2010 for the course COMPUTER S Java2 taught by Professor Kwstasmixail during the Spring '10 term at Technical University of Crete.

Ask a homework question - tutors are online