Assignment #81 and Shorter Double Dice

Code

        /// Name: Trent Lane
    /// Period: 6
    /// Program Name: Counting Machine Revisited
    /// Date Finished: 2/16/2016
    
    import java.util.Scanner;

    public class MachRev
    {
        public static void main(String[] args)
        {
            Scanner keyboard = new Scanner(System.in);
    
            int countTo, countFrom, 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();
    
            for ( int n = countFrom; n <= countTo; n = n + countBy )
            {
                System.out.print(n + " ");
            }
    
            System.out.println();
        }
    }

 

Picture of the output

Assignment 71