Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package javaapplication1;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.FileWriter;
- import java.io.PrintWriter;
- import java.util.Scanner;
- import java.util.Random;
- /**
- *
- * @author 01603679
- */
- public class JavaApplication1 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) throws IOExeption {
- Scanner k = new Scanner(System.in);
- System.out.println("Enter input file name");
- String inputFile = k.nextLine();
- System.out.println("Enter output file name");
- String outputFile = k.nextLine();
- File input = new File(inputFile);
- Scanner s = new Scanner(input);
- FileWriter output = new FileWriter(outputFile, true);
- PrintWriter outputFile = new PrintWriter(output);
- while(s.hasNext())
- {
- String line = s.nextLine();
- outputFile.println(line);
- outputFile.println(rand.nextFloat());
- outputFile.println(rand.nextDouble());
- outputFile.println(rand.nextInt());
- outputFile.println(rand.nextInt(6)+1);
- }
- outputFile.close();
- s.close();
- // TODO code application logic here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement