Assignment #81

Code

/*
jack newsom
period 5
program CountingMachine2
filename CountingMachine2.java
date completed 10/26/15
*/

import java.util.Scanner;

public class CountingMachine2
{
    public static void main( String[] args )
    {
        Scanner bot = new Scanner(System.in);
        
        
        System.out.println("Count from: ");
        int from = bot.nextInt();
        System.out.println();
        
        System.out.println("Count to: ");
        int to = bot.nextInt();
        System.out.println();
        
        System.out.println("Count by: ");
        int by = bot.nextInt();
        System.out.println();
        
        for ( int n = from; n <= to; n = n + by )
        {
            System.out.print( " " + n );
        }
        
        System.out.println();
        
        
    }
}      
    

Picture of the output

Assignment X