Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: import TerminalIO.KeyboardReader ; to import java.util.*;

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default import TerminalIO.KeyboardReader ; to import java.util.*;

                   System.out.println("Are there more customers? Type Yes or No") ;
                   [B]answer=keyboard.readLine() ;[/B]
     
                   if (customerSubtotal>largestSubtotal)
                   {
                       largestSubtotal= customerSubtotal ;    
                   }
                   if (customerSubtotal<smallestSubtotal)
                   {
                       smallestSubtotal= customerSubtotal ;    
                   }    
     
              }while (answer.equalsIgnoreCase("yes"));
     
              System.out.println("Daily total today: $"+dailyTotal) ;
              System.out.println("Number of items sold today: "+itemTotal) ;
              System.out.println("Customers that came today: "+customerCounter) ;
              System.out.println("Largest item of the day: $"+largestItem) ;
              System.out.println("Smallest item of the day: $"+smallestItem) ;
              System.out.println("Largest subtotal of the day: $"+largestSubtotal) ;
              System.out.println("Smallest subtotal of the day: $"+smallestSubtotal) ;
     
         }
    }

    I need to switch the bolded part so it will work with to import java.util.*; but I'm not sure how to do that. Sorry if this is a stupid question.

    Thanks for the help!
    Last edited by qwqw; March 13th, 2014 at 08:34 AM. Reason: removed the links, thanks kevinworkman


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: import TerminalIO.KeyboardReader ; to import java.util.*;

    Instead of posting links to external websites (which many of us can't access due to school/work firewalls), I recommend posting an SSCCE that demonstrates exactly which step you're stuck on.

    The way to approach this is not to go line by line, but to understand exactly what the first approach is doing, then do that same thing in Java. It probably won't be an exact translation of each line, but a translation of the process as a whole.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. The Following User Says Thank You to KevinWorkman For This Useful Post:

    qwqw (March 13th, 2014)

Similar Threads

  1. [SOLVED] Which is more efficient? "import java.package.subpackage" or "import java.package.*"
    By Andrew R in forum Java Theory & Questions
    Replies: 1
    Last Post: August 18th, 2013, 01:11 PM
  2. import java in jsp
    By game06 in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: April 17th, 2013, 07:55 AM
  3. import java in jsp
    By game06 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: April 16th, 2013, 04:26 PM
  4. Import if Import is Found, Else
    By blazedGinger in forum Java Theory & Questions
    Replies: 5
    Last Post: March 9th, 2013, 06:43 PM
  5. Problem with import java.util.*; dont know whats wrong
    By TheLeader in forum What's Wrong With My Code?
    Replies: 4
    Last Post: August 3rd, 2012, 12:33 PM