title: (Homework) Running, but not returning the values I need
body: <p>I am very new to programming. I understand that loops would make this look a lot more efficient. But for right now, I just need to figure out <strong>how to return the correct value</strong>.
  I need to figure out the best animal based on their value. The highest value should be returned.</p>
  
  <ul>
  <li><p><strong>I have changed the code to .equals on the comparing in the statements so now surveyresponse.equals("answer")</strong> It hasn't solved the problems for me.</p></li>
  <li><p>The code is currently running, but only returns <strong>dragon</strong> as the <strong>answer</strong>.</p></li>
  <li>I need the code to return the animal that has the highest value.</li>
  <li><p>The assignment calls for that dog wins all ties, and cats always lose the tie breaker. </p>
  
  <pre><code>import java.util.Scanner;
  
  public class PetSurvey{
   public static void main(String[] args){
    String surveyResponse;
   String y;
    int dogScore, catScore, dragonScore, z;
   dogScore = 0;
   catScore = 0;
   dragonScore = 0;
   z = 0;
   y = "best animal";
  
   Scanner foo = new Scanner( System.in );
  System.out.print(" What is your favorite pet? ");
  System.out.print(" a) Dogs ");
  System.out.print(" b) Cats ");
  System.out.print(" c) Dragons ");
  System.out.print(" d) I like cats, dogs and dragons ");
  surveyResponse = foo.next();
  if (surveyResponse == "a"){
      dogScore = dogScore + 3;}
  if (surveyResponse == "b"){
      catScore = catScore + 3;}
  if (surveyResponse == "c"){
      dragonScore = dragonScore + 3;}
  if (surveyResponse == "d"){
      dogScore = dogScore + 1; 
      catScore = catScore + 1; 
      dragonScore = dragonScore +1;}
  
  System.out.print(" What is your favorite pet? ");
  System.out.print(" a) Dogs ");
  System.out.print(" b) Cats ");
  System.out.print(" c) Dragons ");
  System.out.print(" d) I like cats, dogs and dragons ");
  surveyResponse = foo.next();
  if (surveyResponse == "a"){
      dogScore = dogScore + 3;}
  if (surveyResponse == "b"){
      catScore = catScore + 3;}
  if (surveyResponse == "c"){
      dragonScore = dragonScore + 3;}
  if (surveyResponse == "d"){
      dogScore = dogScore + 1; 
      catScore = catScore + 1; 
      dragonScore = dragonScore +1;}
  
  System.out.print(" What is your favorite pet? ");
  System.out.print(" a) Dogs ");
  System.out.print(" b) Cats ");
  System.out.print(" c) Dragons ");
  System.out.print(" d) I like cats, dogs and dragons ");
  surveyResponse = foo.next();
  if (surveyResponse == "a"){
      dogScore = dogScore + 3;}
  if (surveyResponse == "b"){
      catScore = catScore + 3;}
  if (surveyResponse == "c"){
      dragonScore = dragonScore + 3;}
  if (surveyResponse == "d"){
      dogScore = dogScore + 1; 
      catScore = catScore + 1; 
      dragonScore = dragonScore +1;}
  
  if (dogScore &gt; z){
  z = dogScore;}
  if (catScore &gt; z){
  z = catScore;}
  if (dragonScore &gt; z){
  z = dragonScore;}
  if (dogScore == catScore){
  z = dogScore;}
  if (catScore == dragonScore){
  z = dragonScore;}
  
  if (z == dogScore){
  y = "dog";}
  if (z == catScore){
  y = "cat";}
  if (z == dragonScore){
  y = "dragon";}
  
  System.out.print(" The most popular pet is: " + y + ".");
  }
  
  }
  </code></pre></li>
  </ul>
  
  <p>I would appreciate any help on this, thanks in advance.</p>