Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.69 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. public class movieclass {
  3.         public int Movieid;
  4.         public String Movietitle;
  5.         public int MovieRent;
  6.         public int Available;
  7.        
  8.         public movieclass(int id,String title,int rent, int avail) {
  9.                 Movieid = id;
  10.                 Movietitle = title;
  11.                 MovieRent = rent;
  12.                 Available = avail;
  13.         }
  14.        
  15.  
  16.         public double earning() {
  17.                 double earn = 2.10*MovieRent;
  18.                 return earn;
  19.  
  20.         }
  21.         public void rentcount() {
  22.                 MovieRent += 1;
  23.                 Available -= 1;
  24.         }
  25.        
  26.         public void validation() {
  27.                 double total = 0;
  28.                          if(MovieRent>10)  {
  29.                                  total += 3.15;
  30.                                  System.out.println("Rental Completed.");
  31.                          }
  32.                          else{ 
  33.                                  total += 2.10;
  34.                                  System.out.println("Rental Completed.");
  35.                          }
  36.                  
  37.         }
  38.          
  39.  
  40.        
  41.        
  42. }