Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1. public class RaceTrack {
  2.    
  3.     private int averageLapTime;
  4.     private boolean isRaining;
  5.    
  6.     public void RaceTrack(int averageLapTime, boolean isRaining) {
  7.        
  8.         this.averageLapTime = averageLapTime;
  9.         this.isRaining = isRaining;
  10.        
  11.         System.out.println("Average lap time is " + averageLapTime + " seconds.");
  12.         if (isRaining = true) {
  13.            
  14.             System.out.println("It is currently raining.");
  15.            
  16.         }
  17.         else {
  18.            
  19.             System.out.println("It is currently not raining.");
  20.            
  21.         }
  22.        
  23.     }
  24.    
  25.     public int returnLapInput() {
  26.        
  27.         return averageLapTime;
  28.        
  29.     }
  30.    
  31.     public boolean returnRaining() {
  32.        
  33.         return isRaining;
  34.        
  35.     }
  36.    
  37.     public void determineRaceLeader(int... cars) {
  38.        
  39.         for (int car : cars) {
  40.            
  41.             int id = 1;
  42.             System.out.println("Car " + id + "'s time is: " + car);
  43.             id = id + 1;
  44.            
  45.         }
  46.        
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement