Advertisement
inferno719

Untitled

Sep 30th, 2011
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.82 KB | None | 0 0
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package lab5;
  6. import java.io.*;
  7. //import java.util.Scanner;
  8. import java.util.*;
  9.  
  10. //import java.*;
  11. /**
  12.  *
  13.  * @author rherman
  14.  */
  15. public class Lab5
  16. {
  17.     /**
  18.      * @param args the command line arguments
  19.      */
  20.     public static void main(String[] args) throws IOException
  21.     {
  22.         /*
  23.         System.out.println("Main starts");        
  24.         System.out.println("Reading start.");
  25.         File file = new File("input.txt");
  26.         Scanner in = new Scanner(file);
  27.         //BufferedReader in2 = new BufferedReader(new FileReader("C:\\input.txt"));
  28.         String text = in.nextLine();
  29.         System.out.println(text);
  30.         double x = Double.parseDouble(text);
  31.         System.out.println(x);
  32.         //String y = text
  33.         //in.close();
  34.         //System.out.println(in);
  35.         */
  36.             System.out.println("Main starts");
  37.      
  38.        
  39.         System.out.println("Reading start.");
  40.         File file = new File("input.txt");
  41.         Scanner in = new Scanner(file);
  42.  
  43.         PrintWriter out = new PrintWriter(new FileWriter("output.txt")));
  44.        
  45.         while(in.hasNextLine())
  46.         {
  47.             String text = in.nextLine();
  48.             //double value = convert(text);
  49.             double value;
  50.             StringBuilder clean = new StringBuilder(text);
  51.             char type = clean.charAt(clean.length()-1);
  52.             clean = clean.deleteCharAt(clean.length()-1);
  53.             System.out.println(clean);
  54.             System.out.println(value);
  55.         }
  56.         out.close();
  57.     }    
  58. }      
  59.     convert(String text)
  60.     {
  61. StringBuilder clean = new StringBuilder(text);
  62. char type = clean.charAt(chartAt.length());
  63. clean = clean.deleteCharAt(clean.length()-1);
  64.     }
  65.  
  66.  
  67.  
  68.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement