Assignment 81; CountMachRevamp
Code
// Donovan Rich
// Period 6
// Counting Machine Revisited
// CountMachRevamp.java
// 2/17/2016
import java.util.Scanner;
public class CountMachRevamp
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
int start, end, step;
System.out.print( "Count from: " );
start = keyboard.nextInt();
System.out.print( "\nCount to: " );
end = keyboard.nextInt();
System.out.print( "\nCount by: " );
step = keyboard.nextInt();
for ( int n = start ; n <= end ; n = n+step )
{
System.out.print( n + " " );
}
System.out.println();
}
}
Picture of the output