Results 1 to 3 of 3
  1. #1
    JMONEY15 is offline Member
    Join Date
    Jun 2016
    Location
    Los Angeles
    Posts
    5
    Rep Power
    0

    Default need help with a pseudocode program

    I get one error:

    ReadPhone.java:9: error: cannot find symbol
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    ^
    symbol: class InputStreamReader
    location: class ReadPhone
    1 error

    Java Code:
    import java.io.*;
     
    public class ReadPhone {
       public static void main (String[] args) {
        
          System.out.print("Enter a 10-digit phone number: ");
        
        
          BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
         
          String phone = null;
          String newphone = null;
          phone = in.readLine();
        
          System.out.println("(" + phone.substring(0, 3) + ") " + phone.substring(3, 6) + "-" + phone.substring(6, 10)); 
          System.out.println("Formated phone number is: " + newphone);
        
       }
     
    }
    Last edited by JMONEY15; 06-06-2016 at 04:39 AM.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    27

    Default Re: need help with a pseudocode program

    Have you tried individual imports rather than using '*'?

    Also how are you compiling this?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    trcooke is offline Tim Cooke
    Join Date
    Jul 2014
    Location
    Belfast
    Posts
    101
    Rep Power
    0

Similar Threads

  1. Pseudocode output
    By Mrst in forum New To Java
    Replies: 3
    Last Post: 04-25-2013, 02:44 AM
  2. Replies: 1
    Last Post: 02-14-2013, 04:42 AM
  3. Pseudocode to java (HELP)
    By lordrowin in forum New To Java
    Replies: 1
    Last Post: 02-02-2008, 08:54 AM
  4. Is my Pseudocode correct?
    By Clemenza1983 in forum New To Java
    Replies: 0
    Last Post: 01-29-2008, 04:07 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •