By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,654 Members | 1,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,654 IT Pros & Developers. It's quick & easy.

importing keyboard

P: 2
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


Expand|Select|Wrap|Line Numbers
  1. import java.io.*;
  2. import keyboard.*;
  3. public class course2
  4.  
  5. { public static void main(String[]args)
  6.  
  7.  
  8.  
  9.     {
  10.                 int student=0;
  11.                 int groups=0;
  12.                 int noGroup =0;
  13.                 noGroup = student % groups;
  14.  
  15.                 System.out.println("Please enter the amount of student participating:");
  16.                 student=Keyboard.readInt();
  17.                 System.out.println("");
  18.                 System.out.println("Please enter the amount of groups:");
  19.                 groups=Keyboard.readInt();
  20.                 System.out.print("");
  21.                 System.out.print("");
  22.                 System.out.println("When all of the students have been divided equally into ");
  23.                 System.out.print(groups);
  24.                 System.out.print(" groups");
  25.                 System.out.print("There shall be ");
  26.                 System.out.print(noGroup);
  27.                 System.out.print(" left without a group.");
  28.                 System.out.println ("");
  29.  
  30.  
  31.  
  32.         }
  33. }
Oct 1 '13 #1
Share this Question
Share on Google+
1 Reply


P: 2
Resolved fixed myself...had to use scanner
Oct 1 '13 #2

Post your reply

Sign in to post your reply or Sign up for a free account.