Lina Adam

Greenhorn
+ Follow
since Feb 01, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Lina Adam

One more question please.

first i'll write public class n{public void main // i don't know what to write here please help!



}
18 years ago
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");

for(int k=b;K<=m-1;k++)
{
System.out.println("p("+k+"implies P("+k+1+")is true");
}
System.out.println("P("m+")");
18 years ago