Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //weather.java
- import java.util.Scanner;
- public class weather {
- static //The following are four methods that are used to collect data.
- Scanner keyboard = new Scanner(System.in);
- public static String getDate()
- {
- String theDate;
- System.out.println("Enter the date.");
- theDate = keyboard.next();
- return theDate;
- }
- public static int getHiTemp()
- {
- int hitemp;
- System.out.println("Enter the high temperature for this day.");
- hitemp = keyboard.nextInt();
- return hitemp;
- }
- public static int getLoTemp()
- {
- int lotemp;
- System.out.println("Enter the low temperature for this day.");
- lotemp = keyboard.nextInt();
- return lotemp;
- }
- public static double getPrecipitation()
- {
- double madwata;
- System.out.println("Enter the precipitation for this day.");
- madwata = keyboard.nextDouble();
- return madwata;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement