Assignemnt #81 and Counting Machine Revisited
Code
/// Name: Brian Phillips
/// Period: 5
/// Program name: CountMachine2.java
/// File Name: Counting Machine Revisited
/// Date Finished: 2/25/2016
import java.util.Scanner;
public class CountMachine2
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
System.out.print( "Count from: " );
int n = keyboard.nextInt();
System.out.print( "Count to : " );
int n2 = keyboard.nextInt();
System.out.print( "Count by : " );
int n3 = keyboard.nextInt();
for ( int ok; n <= n2; n = n + n3 )
{
System.out.print( + n + " " );
}
}
}
Picture of the output