Question Details

(Solution document) So I have updated the code to include the MTPet Class, but I am getting 6 symbol errors relating to the pet class designation about cannot find


So I have updated the code to include the MTPet Class, but I am getting 6 symbol errors relating to the pet class designation about cannot find symbol. Can anyone assist and tell me what is missing?


import java.util.Scanner;

public class MTUnit6

{

public static void main(String[] args)

 {


  Scanner scanner = new Scanner(System.in);

  int dogCount = 0;

  int catCount = 0;

  int petNumber = 1;

  String type, name;

  int age;

  double weight;

  boolean isMale;

  String MTPet;



  MTPet pet1 = new MTPet();    // Create three pet objects

  MTPet pet2 = new MTPet();

  MTPet pet3 = new MTPet();


  System.out.println("Welcome to the Java Pet Tracker.n");



  System.out.print("Please enter the type of Pet #" + petNumber + " (Dog or Cat): "); //Pet 1 Entry

   type = scanner.next();

       if(type.equalsIgnoreCase("dog"))

         {dogCount++;}

        else {catCount++;}

    System.out.print("Please enter the name of Pet #"+ petNumber +": ");

    name = scanner.next();

    System.out.print("Please enter the age of " + name + ": ");

    age = scanner.nextInt();

    System.out.print("Please enter the weight of " + name + " in pounds (example 5.2): ");

    weight = scanner.nextDouble();

    System.out.print("Is "+ name +" Male (true/false): ");

    isMale = scanner.nextBoolean();


    pet1.setType(type);   //call methods to store values

    pet1.setName(name);

    pet1.setAge(age);

    pet1.setWeight(weight);

    pet1.setIsMale(isMale);

    petNumber++;

    System.out.println();


    System.out.print("Please enter the type of Pet #" + petNumber + " (Dog or Cat): ");  ///2nd Pet

     type = scanner.next();

       if(type.equalsIgnoreCase("dog")) {dogCount++;}

        else {catCount++;}

     System.out.print("Please enter the name of Pet #"+ petNumber +": ");

     name = scanner.next();

     System.out.print("Please enter the age of " + name + ": ");

     age = scanner.nextInt();

     System.out.print("Please enter the weight of " + name + " in pounds (example 5.2): ");

     weight = scanner.nextDouble();

     System.out.print("Is "+ name +" Male (true/false): ");

     isMale = scanner.nextBoolean();


     pet2.set(type, name, age, weight, isMale); ///call method to store values

     petNumber++;

     System.out.println();


     System.out.print("Please enter the type of Pet #" + petNumber + " (Dog or Cat): "); ///3rd Pet

       type = scanner.next();

         if(type.equalsIgnoreCase("dog")) {dogCount++;}

        else {catCount++;}

     System.out.print("Please enter the name of Pet #"+ petNumber +": ");

     name = scanner.next();

     System.out.print("Please enter the age of " + name + ": ");

     age = scanner.nextInt();

     System.out.print("Please enter the weight of " + name + " in pounds (example 5.2): ");

     weight = scanner.nextDouble();

     System.out.print("Is "+ name +" Male (true/false): ");

     isMale = scanner.nextBoolean();


     pet3.set(type, name, age, weight, isMale); ///call method to store values



     System.out.println("nnProcess Pet Population...");

       if(dogCount > 0 && catCount > 0)

         {System.out.println("I sure hope the cats and dogs get along!");}


     System.out.println("nPet Registration Information:");

     pet1.displayPet();

     System.out.println();

     pet2.displayPet();

     System.out.println();

     pet3.displayPet();

     System.out.println();



   }   //End Main

}    //End Pet Registration Program

 


Solution details:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Dec 08, 2020

PRICE: $15

Solution~000652147569744.zip (25.37 KB)

Buy this answer for only: $15

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free solution (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Dec 08, 2020

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.

Order Now