Define a method printall

Assignment Help JAVA Programming
Reference no: EM131578935

Define a method printAll() for class PetData that prints output as follows. Hint: Make use of the base class' printAll() method.Name: Fluffy, Age: 5, ID: 4444

// ===== Code from file AnimalData.java =====
public class AnimalData {
private int ageYears;
private String fullName;
public void setName(String givenName) {
fullName = givenName;
return;
}
public void setAge(int numYears) {
ageYears = numYears;
return;
}
// Other parts omitted
public void printAll() {
System.out.print("Name: " + fullName);
System.out.print(", Age: " + ageYears);
return;
}
}
// ===== end =====
// ===== Code from file PetData.java =====
public class PetData extends AnimalData {
private int idNum;
public void setID(int petID) {
idNum = petID;
return;
}

// FIXME: Add printAll() member function
/* Your solution goes here */

}
// ===== end =====
// ===== Code from file BasicDerivedOverride.java =====
public class BasicDerivedOverride {
public static void main (String [] args) {
PetData userPet = new PetData();
userPet.setName("Fluffy");
userPet.setAge (5);
userPet.setID (4444);
userPet.printAll();
System.out.println("");
return;
}
}
// ===== end =====

Reference no: EM131578935

Questions Cloud

How might we ensure that there is a truer implementation : How might we ensure that there is a truer implementation, why is there often a disconnect between the intentions of reformers
What is m in terms of vertices : Is there some number m such that if a graph with v vertices is connected and has m edges, then it is a tree? If so, what is m in terms of v?
What would happen to the value : What would happen to the value of the 10-year bond over time if the required rate of return remained at 13 percent, or if it remained at 7 percent?
What is its relationship to issues of victims : What is meant by rape culture, what are its characteristics, and what is its relationship to issues of victims and victimization
Define a method printall : Define a method printAll() for class PetData that prints output as follows. Hint: Make use of the base class' printAll() method
Describe the software technology that you will need to build : Describe the software technology that you will need to build your e-commerce site. Why did you choose this particular software?
Print member method and a separate println statement : Use the print member method and a separate println statement to output courseStudentss data -
Find the number of edges in a graph : Is there a relationship between the number of edges in a graph and the degrees of the vertices? If so, find it. Hint: computing degrees of vertices and number.
Lottery commission uses a discount rate : Or, you can take a lump sum payment today. If the lottery commission uses a discount rate of 11.17% APR, how much would you expect to receive today?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Implementation of a simple java class

The purpose of this lab is to gain experience in the design and implementation of a simple Java class.  You will create a class definition and write a simple main method that will test the methods of your class to ensure they work as expected.

  Why the given is not running properly

Purpose: To process messages similar to TtT tweets and pull out information form the text, manipulate it, and print it out on the screen

  Describe how a semaphore can be used to act like a lock.

The loop should execute until a "shutdown" flag is set to true on the runnable object executing in the thread.

  Create and code a program uses three parallel numeric array

Create and code a program that uses three parallel numeric arrays of size 6. The program searches one of the arrays and then displays the corresponding values from the other two arrays. The program should prompt the user to enter a ProductID. Valid P..

  How to open web pages in java as a string

How to open Web pages in Java as a string? Open a given Web page as its source file.

  Create web application uses visual web java server

Create the Web application which uses Visual Web Java Server Faces framework and either Apache Tomcat or Glassfish as the server.

  Explain the problem and then write the pseudo code for it

There are Java compilers and interpreters. Write a 1 page paper on compilers and interpreters (2-3 paragraphs on each topic). Discuss the advantages and disadvantages of compilers and interpreters.

  How to link different classes forms

How to link different classes forms. When a person clicks on A, B, or C the program will go to the addEmployee form or Punch In/Out form in Java.

  String as input and returns the reverse of that string

Write a method that takes a String as input and returns the reverse of that String. Then write a second method that uses the first method to test whether or not an input String is a palindrome.

  Create a console based non-gui java program

Create a console based, non-GUI Java program using NetBeans Integrated Development Environment (IDE) that displays "Hello world!".Take a screenshot that shows the program's successful compilation and execution.

  Methods that require multiple parameters

Methods that require multiple parameters. The program prompts the user for two numeric values.

  State a java class named accumulator the class comprises

question define a java class named accumulator. the class contains the following elementsa. an integer variable named

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd