title: Babysitting Application
body: <p>The question is quite lengthy but i hope the information I have provided is sufficient. All the code works except for the point where I have to construct a <code>BaysittingJob</code> object and display its values. Thank you so much.</p>
  
  <p>I cannot get the application to output the desired results. It is supposed to:</p>
  
  <ol>
  <li>Display a job number with two digits of the year and a four digit sequential number</li>
  <li>The assined babysitter based on the baby sitter code selected (code is from 1 to 3)</li>
  <li>The number of children</li>
  <li>The number of hours worked</li>
  <li>A fee based on the number of hours worked and the babysitter selected
  If babysitter code is 1, $7 per hour fee is charged
  If babysitter code is 2 or 3, fee is $9 per hour for the first child and $4 per additional hour for each additional child</li>
  </ol>
  
  <p><code>BabysittingJob</code></p>
  
  <pre><code>public class BabysittingJob {
  
      private int jobNumber;
      private int babysitterCode;
      private String babysitter;
      private int childrenNumber;
      private int hoursWorked;
      private double fee;
  
      public BabysittingJob(int year, int sequentialNumber, int babysitterCode, int childrenNumber, int hoursWorked, String babysitter) {
          year = year % 2000;
          int jobNumber = ((year * 10000) + sequentialNumber);
          if (babysitterCode == 1) {
              babysitter = "Cindy";
          } else if (babysitterCode == 2) {
              babysitter = "Greg";
          } else if (babysitterCode == 3) {
              babysitter = "Marcia";
          }
      }
  
      {
  
          if (babysitterCode == 1) {
              fee = hoursWorked * 7 * childrenNumber;
          } else if (babysitterCode &gt; 1 &amp;&amp; childrenNumber == 1) {
              fee = hoursWorked * 9 * childrenNumber;
          } else if (babysitterCode &gt; 1 &amp;&amp; childrenNumber &gt; 1) {
              fee = (hoursWorked * 9) + ((--childrenNumber) * hoursWorked * 4);
          }
      }
  
      public void displayResult() {
          System.out.println("Your job number is:" + jobNumber + "Your baby sitter is:" + babysitter
                  + "The number of children is:" + childrenNumber + "The number of hours worked is:"
                  + hoursWorked + "Your fee is $:" + fee);
      }
  }
  </code></pre>
  
  <p><code>CreateBabysittingJob</code>...</p>
  
  <pre><code>import java.util.Scanner;
  
  public class CreateBabysittingJob {
  
      public static void main(String[] args) {
          Scanner input = new Scanner(System.in);
          System.out.print("Enter year.");
          int year = input.nextInt();
          while (year &lt; 2013 || year &gt; 2025) {
              System.out.println("Enter a year between 2013 and 2025");
              year = input.nextInt();
          }
          System.out.print("Enter job number");
          int jobNumber = input.nextInt();
          while (jobNumber &lt; 1 || jobNumber &gt; 9999) {
              System.out.println("Enter a number between 1 and 9999");
              jobNumber = input.nextInt();
          }
          System.out.print("Enter babysitter code");
          int babysitterCode = input.nextInt();
          while (babysitterCode &lt; 1 || babysitterCode &gt; 3) {
              System.out.println("Enter a number between 1 and 3");
              babysitterCode = input.nextInt();
          }
          System.out.print("Enter number of children");
          int childrenNumber = input.nextInt();
          while (childrenNumber &lt; 1 || childrenNumber &gt; 9) {
              System.out.println("Enter a number between 1 and 9");
              childrenNumber = input.nextInt();
          }
          System.out.print("Enter number of hours");
          int hoursWorked = input.nextInt();
          while (hoursWorked &lt; 1 || hoursWorked &gt; 12) {
              System.out.println("Enter a number between 1 and 12");
              hoursWorked = input.nextInt();
          }
          BabysittingJob ca = new BabysittingJob(year, jobNumber, babysitterCode, childrenNumber, hoursWorked);
          ca.displayResult();
      }
  }
  </code></pre>