Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exception in thread main java.lang.Error: Unresolved compilation problem: at dogClass2.Dog.main(dogClass2.java:7) Help please trying to write code for dog class in java. package dogClass2; import java.util.Scanner;

Exception in thread "main" java.lang.Error: Unresolved compilation problem: at dogClass2.Dog.main(dogClass2.java:7) Help please trying to write code for dog class in java.

package dogClass2; import java.util.Scanner; public class Dog { public static void main(String[] args) { Scanner scnr = new Scanner(System.in);

Dog Dog = new Dog(); String dogName, dogBreed; int dogWeight, dogAge; dogWeight = scnr.nextInt(); scnr.nextLine(); dogName = scnr.next(); dogAge = scnr.nextInt(); scnr.nextLine(); dogBreed = scnr.nextLine();

//

TODO: Create dog pet (using dogName, dogAge, dogBreed, dogWeight) and then call printInfo Dog.setName(dogName); Dog.setAge(dogAge); Dog.setBreed(dogBreed); Dog.setWeight(dogWeight); Dog.printInfo(); //TODO: output the breed, the age, the weight System.out.println(" Breed: " + Dog.getBreed()); }

private void setWeight(int dogWeight) { // TODO Auto-generated method stub

}

private static void printInfo() { // TODO Auto-generated method stub }

private void setAge(int dogAge) { // TODO Auto-generated method stub }

private void setBreed(String dogBreed) { // TODO Auto-generated method stub }

private void setName(String dogName) { // TODO Auto-generated method stub }

private String getBreed() { // TODO Auto-generated method stub return null; } }

/** * @author marcusstanley_snhu * */ public class dogClass2 {

/** * */ public dogClass2() { // TODO Auto-generated constructor stub }

/** * @param args */

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions