Assignemnt #81 and Revamped Counting Machine
Code
///Name: Daniel Tiffany-Appleton
///Period: 7
///Program Name: Revamped Counting Machine
///File Name: RevampedCountingMachine
///Date Finished: 2/3/16
import java.util.Scanner;
public class RevampedCountingMachine
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
int countFrom, countTo, countBy;
System.out.print( "Count from: " );
countFrom = keyboard.nextInt();
System.out.print( "Count to: " );
countTo = keyboard.nextInt();
System.out.print( "Count by: " );
countBy = keyboard.nextInt();
System.out.println( " " );
for ( int n = countFrom ; n <= countTo ; n = n+countBy )
{
System.out.print( n + " " );
}
}
}
Picture of the output