Advertisement
GazaIan

Untitled

Feb 6th, 2015
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1. //weather.java
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class weather {
  6.    
  7.     static //The following are four methods that are used to collect data.
  8.  
  9.     Scanner keyboard = new Scanner(System.in);
  10.    
  11.     public static String getDate()
  12.     {
  13.         String theDate;
  14.         System.out.println("Enter the date.");
  15.         theDate = keyboard.next();
  16.         return theDate;
  17.     }
  18.  
  19.     public static int getHiTemp()
  20.     {
  21.         int hitemp;
  22.         System.out.println("Enter the high temperature for this day.");
  23.         hitemp = keyboard.nextInt();
  24.         return hitemp;
  25.     }
  26.    
  27.     public static int getLoTemp()
  28.     {
  29.         int lotemp;
  30.         System.out.println("Enter the low temperature for this day.");
  31.         lotemp = keyboard.nextInt();
  32.         return lotemp;
  33.     }
  34.    
  35.     public static double getPrecipitation()
  36.     {
  37.         double madwata;
  38.         System.out.println("Enter the precipitation for this day.");
  39.         madwata = keyboard.nextDouble();
  40.         return madwata;
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement