subject

LAB: Pet information (derived classes) The base class Pet has private fields petName, and petAge. The derived class Dog extends the Pet class and includes a private field for dog Breed. Complete main() to: • create a generic pet and print information using printinfo(). • create a Dog pet, use printInfo() to print information, and add a statement to print the dog's breed using the getBreed method. Ex. If the input is: Dobby Kreacher German Schnauzer the output is: Pet Information: Name: Dobby Age: 2 Pet Information: Name: Kreacher Age: 3 Breed: German Schnauzer LAB ACTIVITY 100 10.9.1: LAB: Pet information (derived classes) 0/10 Current file: PetInformation. java - Load default template... 1 import java. util. Scanner; public class Pet Information { public static void main(String[] args) { Scanner scnr = new Scanner(System. in); Pet my Pet = new Pet(); Dog myDog = new Dog(); String petName, dogName, dogBreed; int petAge, dogAge; petName = scnr. nextLine(); petAge = scnr. nextInt(); scnr. nextLine(); dogName = scnr. next(); dogAge = scnr. nextInt(); scnr. nextLine(); dogBreed = scnr. nextLine();

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 15:10
What is word processing and word wrap?
Answers: 1
question
Computers and Technology, 22.06.2019 19:00
The fourth generation of computers emerged between 1970s and 1980s. which technological advancement brought about this generation of computers? which computer architecture was used most in this generation?
Answers: 3
question
Computers and Technology, 22.06.2019 22:00
What is the name of the option in most presentation applications with which you can modify slide elements? 1. the option enables you to modify a slide element in most presentation applications.
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
Which is a possible benefit of having a good credit history? having a checking account low interest rate on a car loan high interest rate on a credit card offer bankruptcy
Answers: 1
You know the right answer?
LAB: Pet information (derived classes) The base class Pet has private fields petName, and petAge. Th...
Questions
question
History, 06.11.2020 01:20
question
Mathematics, 06.11.2020 01:20
question
Mathematics, 06.11.2020 01:20
question
English, 06.11.2020 01:20
question
Mathematics, 06.11.2020 01:20
Questions on the website: 13722367