From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1f527e46e2b0d9dc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-06 07:35:12 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!feeder.qis.net!news.maxwell.syr.edu!pln-e!spln!dex!extra.newsguy.com!newsp.newsguy.com!drn From: me@_ Newsgroups: comp.lang.ada Subject: Re: Java / Keyboard class, neophyte stumped Date: 6 Oct 2001 07:19:22 -0700 Organization: Newsguy News Service [http://newsguy.com] Message-ID: <9pn3ta0up2@drn.newsguy.com> References: <7b4af09f.0110060529.368829c8@posting.google.com> NNTP-Posting-Host: p-361.newsdawg.com X-Newsreader: Direct Read News 2.90 Xref: archiver1.google.com comp.lang.ada:13831 Date: 2001-10-06T07:19:22-07:00 List-Id: You do know about classpath in java, right? and btw, Ada is not java, it is a different language. so this question is send to the wrong group. In article <7b4af09f.0110060529.368829c8@posting.google.com>, the_edwards@ameritech.net says... > >I am tryin to use the Keyboard class included >in a book by John Lewis. I get the following >error messages: >C:\MyJava\EvenNumber.java:9: cannot resolve symbol >symbol : class keyboard >location: package cs1 >import cs1.keyboard; > ^ >C:\MyJava\EvenNumber.java:26: cannot resolve symbol >symbol : variable keyboard >location: class EvenNumber > num = keyboard.readInt(); > ^ >2 errors > > >Here is my code: > >import cs1.keyboard; >import java.io.*; > > >public class EvenNumber >{ > > public static void main (String[] args) > > { > int num=0; > int sum=0; > int test=0; > > // keyboard input > System.out.println ("Input any integer over the value of 2: "); > System.out.println (" "); > num = keyboard.readInt(); > > while (test == 0) //loop to repeat test for >2 condition > { > > if (num < 2) //Test to determine if the number is over 2 > { > System.out.println ("The number you entered was less than 2"); > System.out.println ("Please enter another integer: "); > // num = Keyboard.readInt(); > test = 0; > } > else > test = 1; > > } > > > > // loop to add all even integers > for (int i=0; i<=num; i=i+2) > { > sum=sum+i; > } > // print out results > System.out.println ("The sum of all even integers between"); > System.out.println ("2 and your integer, "+ num + ", is: " + sum); > System.out.println (" "); > > > } >}