importing keyboard

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FLYINGROBOCOP
    New Member
    • Oct 2013
    • 2

    importing keyboard

    ive literally only started java in college but am familiar with c++

    im trying to import the keyboard...i downloaded the class and mapped it but it aint working..is the fault in my code?? please help and thank you


    Code:
    import java.io.*;
    import keyboard.*;
    public class course2
    
    { public static void main(String[]args)
    
    
    
    	{
    				int student=0;
    				int groups=0;
    				int noGroup =0;
    				noGroup = student % groups;
    
    				System.out.println("Please enter the amount of student participating:");
    				student=Keyboard.readInt();
    				System.out.println("");
    				System.out.println("Please enter the amount of groups:");
    				groups=Keyboard.readInt();
    				System.out.print("");
    				System.out.print("");
    				System.out.println("When all of the students have been divided equally into ");
    				System.out.print(groups);
    				System.out.print(" groups");
    				System.out.print("There shall be ");
    				System.out.print(noGroup);
    				System.out.print(" left without a group.");
    				System.out.println ("");
    
    
    
    		}
    }
    Last edited by Rabbit; Oct 1 '13, 08:49 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.
  • FLYINGROBOCOP
    New Member
    • Oct 2013
    • 2

    #2
    Resolved fixed myself...had to use scanner

    Comment

    Working...