Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package lab5;
- import java.io.*;
- //import java.util.Scanner;
- import java.util.*;
- //import java.*;
- /**
- *
- * @author rherman
- */
- public class Lab5
- {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) throws IOException
- {
- /*
- System.out.println("Main starts");
- System.out.println("Reading start.");
- File file = new File("input.txt");
- Scanner in = new Scanner(file);
- //BufferedReader in2 = new BufferedReader(new FileReader("C:\\input.txt"));
- String text = in.nextLine();
- System.out.println(text);
- double x = Double.parseDouble(text);
- System.out.println(x);
- //String y = text
- //in.close();
- //System.out.println(in);
- */
- System.out.println("Main starts");
- System.out.println("Reading start.");
- File file = new File("input.txt");
- Scanner in = new Scanner(file);
- PrintWriter out = new PrintWriter(new FileWriter("output.txt")));
- while(in.hasNextLine())
- {
- String text = in.nextLine();
- //double value = convert(text);
- double value;
- StringBuilder clean = new StringBuilder(text);
- char type = clean.charAt(clean.length()-1);
- clean = clean.deleteCharAt(clean.length()-1);
- System.out.println(clean);
- System.out.println(value);
- }
- out.close();
- }
- }
- convert(String text)
- {
- StringBuilder clean = new StringBuilder(text);
- char type = clean.charAt(chartAt.length());
- clean = clean.deleteCharAt(clean.length()-1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement