/* 10/30/2017
 Programming Process:
 1. Understand problem
 2. Develop and algorithm (use pseudocode)
 3. Code in Java
 4. Debug
 5. Test --
 Put together datasets for which the program behaves differently.
 Try each data set, sometimes this is called a "test suite"
 We can also call the method inside of a loop to test it on many
 different values.
*/
import java.util.Scanner;

/**
 * This class converts degrees celcius to degrees faranheit and prints a table.
 */
public class CelciusToFaranTble {
  
  /** main method uses a for loop and does the conversion
   */
  
  public static void main(String[] args)   {
    
       double faran;
       int celcius=100;
       System.out.print("Enter upper limit for table: ");
       Scanner in = new Scanner(System.in);
       int limit=in.nextInt();
       System.out.println("Celcius    Faranheit");
       System.out.println("--------------------");
       // calculate faranheit from celcius and print it
       for (celcius=-100; celcius<=limit; celcius+=99) {
         System.out.printf("%4d %12.2f\n",celcius,celTofaran(celcius));
       }
   }
  /** this method converts degrees celcius to faranheit.
    * @param an integer representing degrees celcius
    * @return double that represents degrees faranheit
    */
  public static double celTofaran(int celcius)
  {
    double faran = celcius * (9 / 5.0) + 32; 
    return faran;
  }
}

