Assignemnt #81: Counting Machine Revisited
Code
/// Name: Kelsey Lieberman
/// Period 5
/// Program Name: CountingMachineRevisited
/// File Name: CountingMachineRevisited.java
/// Date Finished: 1/4/2016
import java.util.Scanner;
public class CountingMachineRevisited
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
System.out.print("Count from: ");
int from = keyboard.nextInt();
System.out.print("Count to :");
int to = keyboard.nextInt();
System.out.print("Count by: ");
int by = keyboard.nextInt();
System.out.println();
for ( int x = from ; x <= to ; x = x + by)
System.out.println( x + "\t");
}
}
Picture of the output