Assignemnt 99 and Fill In Functions

Code

    /// Name: Xinting Chen
    /// Period: 7
    /// Program Name: Fill In Functions
    /// File Name: FillInFunctions.java
    /// Date Finished: 3/30/2016
  
        public class FillInFunctions
        {
        	public static void main( String[] args )
        	{
        
        		System.out.println("Watch as we demonstrate functions.");
        
        		System.out.println();
        		System.out.println("I'm going to get a random character from A-Z");
        		char c = '!';
        		randChar();
        		System.out.println("The character is: " + randChar() );
        
        		System.out.println();
        		System.out.println("Now let's count from -10 to 10");
        		int begin, end;
        		begin = -10;
        		end = 10;
        		counter(begin,end);
        		System.out.println("How was that?");
        
        		System.out.println();
        		System.out.println("Now we take the absolute value of a number.");
        		int x, y = 99;
        		x = -10;
        		System.out.println("|" + x + "| = " + y );
        
        		System.out.println();
        		System.out.println("That's all.  This program has been brought to you by:");
        		credits();
        	}
        
        	public static void credits()
        	{
        
        		System.out.println();
        		System.out.println("programmed by Graham Mitchell");
        		System.out.println("modified by Mark Katz");
        		System.out.print("This code is distributed under the terms of the standard ");
        		System.out.println("BSD license.  Do with it as you wish.");
            
        	}
        
        
        	public static char randChar()
        
        	{
        		
        		int numval;
        		char charval;
        		numval = (int)(Math.random()*26);
        		charval = (char) ('A' + numval);
                
                return charval;
        
        	}
    
        	public static void counter(int begin, int end)
                   
        	{
    	
        		while ( begin <= end )
        		{
        			System.out.print(begin + " ");
        			begin = begin+1;
        		}
        
        	}
       
        	public static int abso(int x)
        	{
                int absval;		
        
        		if ( x < 0 )
        			absval = -x;
        		else
        			absval = x;
                return absval;
        
        	}
   
        }





    

Picture of the output

Assignment 99