title: Car Rental Java lab
body: <p>Background:
  When you rent a car from an agency, the key ring has several pieces of information: license plate, make and year of car, and usually a special code. This code could be used for some data processing within the
  company's computers. This lab will practice determining that special car rental code from the license
  plate.</p>
  
  <p>Assignment:</p>
  
  <ol>
  <li>The following sequence of steps will be used to convert a sample license plate into a car rental code.</li>
  </ol>
  
  <p>a. A license plate consists of 3 letters followed by a space, followed by a 3-digit integer. For example, CPR 607.</p>
  
  <p>b. Add up the ASCII values of the 3 letters, 67 + 80 + 82 = 229.</p>
  
  <p>c. Add the sum of the letters to the 3-digit integer. For example, 229 + 607 = 836.</p>
  
  <p>d. Take this sum (836) and determine the integer remainder after dividing by 26:
  836 % 26 = 4.</p>
  
  <p>e. Determine the 4th letter in the alphabet after the letter 'A': 4th letter after 'A' = 'E'</p>
  
  <p>f. Combine the letter and the sum. Thus, we have CPR 607 = E836.</p>
  
  <ol start="2">
  <li>You may assume that all sample data will be in the format of 3 alphabet characters, then a space,
  followed by a 3-digit integer.</li>
  </ol>
  
  <p>Thats my code 
  import static java.lang.System.*;</p>
  
  <pre><code>public class CarRental 
  
     { private String licenseletters;
       private int licensenumber;
  
  
       public CarRental()
     {
       licenseletters="";
       licensenumber=0;
  
     }
       public CarRental(String a, int b) 
     {
       licenseletters=a;
       licensenumber=b;
     }
  
       public void setletters(String a, int b) 
     {
       licenseletters=a;
       licensenumber=b;
     }
  
       public int getASCIIone()
     {
       return (int)licenseletters.charAt(0); 
     }
       public int getASCIItwo()
     {
       return (int)licenseletters.charAt(1); 
     }
       public int getASCIIthree()
     {
       return (int)licenseletters.charAt(2); 
     }
  
  
  
      public int addASCII()
     {
      int total=  getASCIIone() + getASCIItwo() + getASCIIthree(); 
      return total;
     }
      public int adddigits()
     {
      int sum= addASCII() + licensenumber;
      return sum;
     }
      public int remainder()
     {
      int remain= adddigits()%26;
      return remain;
  
     }
      public int aftera()
     {
      int aftera= remainder()+65;
      return aftera;
     }
     public char letteraftera()
     {
      char letteraftera= (char)aftera();
      return letteraftera;
      }
       public String tostring()
      {
       return ""+ letteraftera() + adddigits();
       }
  
       }
  </code></pre>
  
  <p>Thats my runner code and I am getting an error at the constructor part right before the word new</p>
  
  <pre><code> import static java.lang.System.*;
  
   import java.util.Scanner;
  
   public class CarRentalRunner
   {
    public static void main( String args[] )
   {
    for(int b=0; b&lt;10; b=b+1){
    Scanner keyboard=new Scanner(System.in);
    System.out.print("Make=");
    String carmake= keyboard.nextLine();
    System.out.print("Model=");
    String carmodel=keyboard.nextLine();
  
  
    System.out.print("Enter the license plates number");
    String a= keyboard.next();
  
    int c= keyboard.nextInt();
    CarRentalRunner Java = new CarRentalRunner(a,b);
    System.out.println(Java);
    }
    }
    }
  </code></pre>