i have to program in Java.All inputs and outputs are performed through the standard I/O.My program should do the following: �Read two integers b and m.The numbers are separated by a single space.they will be on the same line,and no other characters will appear on that line.And 0 <= b <m = 100,000. �Print �Induction Expander�,followed by a newline. �Print �If you show:�,followed by a newline �Print �that P(b)is true�,substituting the number b you read in,followed by a newline. �Print �and that for all k >=b,if P(k)is true,then P(k+1)is true.�,substituting in the b you read in,followed by a newline. �Print �Then:�,followed by a newline. Print �P(b)is true.�,substituting the number b you read in,followed by a newline.The program should then go into a loop,where a counter k goes from b to m-1;for each value of k,print �P(k)is true implies P(k +1)is true.�,followed by a newline.Make sure to replace k and k +1 with the correct values. �Before exiting,print �Therefore,P(m)is true.�,followed by a newline.The italicized m must be replaced by the actual value of m.
Here is what i did // i know that ihave to use buffer reader but i don't know how and i also know that i have to use the tokenizer System.out.println("Induction Expander");
System.out.println("If you show:"); System.out.println("that P("+b+")is true"); System.out.println("Then");
CAN U SEND WHOLE PROGRAM WITH THE HELP OF PIECE OF CODE AM AN ABLE TO EXPLAIN OK
Joined: Dec 06, 2001
If you are using Java 1.5, then you should use the Scanner class instead. It provides some methods that allow you to conveniently read primitive types from a stream. If you want to stick with the old-school i/o classes, take a look at the I/O Trail from Sun's Java tutorial (see the link in my signature for the full tutorial). If you use the right I/O classes, you won't even need to use a tokenizer. You should browse through the java.io package in the API (link in signature) to see if you can find any classes and methods will help you with this task.