Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am recieving the following errors for the program listed below, can someone he

ID: 3639472 • Letter: I

Question

I am recieving the following errors for the program listed below, can someone help out.
java:112: variable declawed might not have been initialized
java:112: variable age might not have been initialized
java:115: variable name might not have been initialized

once compiled and working correctly I should get the program to print out and allow user input for each cat, then after input for all three cats has been inputted, the program is supposed to print out the following report:

Names of cats >=3 that have claws
Name
age

/*********************************************************************************************************
*CatClawsProg.java
*
*This program collects data on cats and returns the information while identifing cats over 3 with claws
**********************************************************************************************************/

import java.util.*;

public class CatClawsProg
{
public static void main(String[] args)
{

/*********************************************************************************
*Initialize cats and User Input
*
*********************************************************************************/
{
Cat cat1=new Cat(); // initialize cat 1

Scanner input=new Scanner(System.in);

System.out.println("Enter the name of Cat 1:"); //user input cats name
String name=input.next();

System.out.println("Enter the age of Cat 1:"); //user input cats age
int age=input.nextInt();

System.out.println("Enter the weight of Cat 1:"); //user input cats weight
double weight=input.nextDouble();

System.out.println("Enter the breed of Cat 1:"); //user input cats breed
String breed=input.next();

System.out.println("Does Cat 1 have claws? True or False"); //user input (True; cats has claws, False; cat is declawed)
boolean declawed=input.nextBoolean();

cat1.set(name, age, weight);
cat1.setBreed(breed);

System.out.println(cat1.getName());
System.out.println(cat1.getBreed());
} // end cat 1

{
Cat cat2=new Cat(); // initialize cat 2

Scanner input=new Scanner(System.in);

System.out.println("Enter the name of Cat 2:"); //user input cats name
String name=input.next();

System.out.println("Enter the age of Cat 2:"); //user input cats age
int age=input.nextInt();

System.out.println("Enter the weight of Cat 2:"); //user input cats weight
double weight=input.nextDouble();

System.out.println("Enter the breed of Cat 2:"); //user input cats breed
String breed=input.next();

System.out.println("Does Cat 2 have claws? True or False"); //user input (True; cats has claws, False; cat is declawed)
boolean declawed=input.nextBoolean();

cat2.set(name, age, weight);
cat2.setBreed(breed);

System.out.println(cat2.getName());
System.out.println(cat2.getBreed());
} // end cat 2

{
Cat cat3=new Cat (); // initialize cat 3

Scanner input=new Scanner(System.in);

System.out.println("Enter the name of Cat 3:"); //user input cats name
String name=input.next();

System.out.println("Enter the age of Cat 3:"); //user input cats age
int age=input.nextInt();

System.out.println("Enter the weight of Cat 3:"); //user input cats weight
double weight=input.nextDouble();

System.out.println("Enter the breed of Cat 3:"); //user input cats breed
String breed=input.next();

System.out.println("Does Cat 3 have claws? True or False"); //user input (True; cats has claws, False; cat is declawed)
boolean declawed=input.nextBoolean();

cat3.set(name, age, weight);
cat3.setBreed(breed);

System.out.println(cat3.getName());
System.out.println(cat3.getBreed());
} // end cat 3

/********************************************************************************
*Feedback provided; Identifies cats 3 years and older with claws
*
********************************************************************************/
String name;
int age;
double weight;
String breed;
boolean declawed;

for (int i=1; i<=3; i++)

if (((boolean) declawed) && (age>=3))
{
System.out.println("The cats over 3 with claws are:");
System.out.println("Name:" + name);
System.out.println("Age :" + age + "Years Old");

}//end if

}//end main

}//end public class CatClawsProg

Explanation / Answer

uninitialized means they dont have a initial value rather garbage value given to it
define a initial value for them..
age = 0, name = "" etc

 

this may also occur due to the fact that there is no getname function