Assignment #81 and CountingMachineRevisited
Code
/// Name: Jason Kim
/// Period: 7
/// Program Name: CountingMachineRevisited
/// File Name: CountingMachinerevisited.java
/// Date Finished:11/30/15
import java.util.Scanner;
public class CountingMachineRevisited
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int start, end, increment;
System.out.print("Count from: ");
start = keyboard.nextInt();
System.out.print("Count to: ");
end = keyboard.nextInt();
System.out.print("Count by: ");
increment = keyboard.nextInt();
for ( int n = start ; n <= end; n = n + increment)
{
System.out.print( n + " ");
}
System.out.println();
}
}
Picture of the output