81. Counting Machine Revisited
Code
///Name: Tyler Hart
///Period:5
///Project Name: Counting Machine Revisited
///File Name:CountingMachineR.java
///2/27/2016
import java.util.Scanner;
public class CountingMachineR
{
public static void main( String[] args )
{
int f,t,b;
Scanner key = new Scanner(System.in);
System.out.println("count from: ");
f = key.nextInt();
System.out.println("count to: ");
t = key.nextInt();
System.out.println("count by: ");
b = key.nextInt();
for ( int n = f ; n <= t ; n = n+b )
{
System.out.println( "Mr. Davis is cool" );
}
}
}
Picture of the output