1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vichka [17]
4 years ago
10

Define a method printAll() for class PetData that prints output as follows with inputs "Fluffy", 5, and 4444. Hint: Make use of

the base class' printAll() method. Name: Fluffy, Age: 5, ID: 4444
Computers and Technology
1 answer:
Vsevolod [243]4 years ago
3 0

Answer and Explanation:

public class petData

{

private int ageYears;

private String fullName;

private int IdNumber;

public void setName (String givenName)

{

fullName = givenName;

return;

}

public void setAge (int numYears)

{

ageYears = numYears;

return;

}

public void setID (int numID)

{

IdNumber = numID;

return;

}

public void printAll ()

{

System.out.print ("Name: " + fullName);

System.out.print (", Age: " + ageYears);

return;

}

}

From the above, we have defined a class petData, with methods setName, setAge, printAll. These methods all make use of the string variable fullName and integer variable ageYears. From the above, setName method sets fullName variable to name given to its string parameter givenName while setAge method does the same with the ageYears variable in initializing it. This is also done by the ID method. These variables are then used by printAll method in printing out the Name and age of the object which would be created with the petData class

E. g: petData dog= new petData();

You might be interested in
How do companies use web sites?
kramer

they us websites to look thing up that are need

hope this helps

5 0
4 years ago
Select the correct answer from each drop-down menu.
Gnesinka [82]

Answer:

Explanation:

creating .

6 0
4 years ago
ad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (an
WINSTONCH [101]

Answer:

Python

name =input("")  #input name

location = input("")  #input location

number = int(input(""))  #input number

pluralNoun = input("")  #input plural noun

print(name, 'went to', location, 'to buy', number, 'different types of', pluralNoun) #prints the short story using input variables

JAVA:

import java.util.Scanner;   // to accept input from user

public class Main {  

public static void main(String[] args) {  //start of main function

  Scanner input = new Scanner (System.in) ; //creates Scanner class object

   String subject;  //declares string type variable to hold name

   String location;  //declares string type variable to hold location

   int number;  //declares int type variable to hold number

   String object;  //declares string type variable to hold plural noun

  subject = input.next();  //reads input subject string value

  location = input.next();  //reads input location string value

  number = input.nextInt();  //reads input number integer value

  object = input.next();  //reads input object string value

  System.out.println(subject + " went to " + location + " to buy " + number + " different types of " + object + "."); } } //prints the short story using input values and existing string added with input values

In C++

#include <iostream> //to use input output functions

using namespace std; //to identify objects like cin cout

int main(){ //start of main function

   string first_name; // string variable that holds the first_name value

   cin>>first_name; //reads the first_name from user

   string generic_location; // string variable that holds the generic location

   cin>>generic_location; //reads the generic location  from user

   int whole_number; // int variable that holds the whole_number value

   cin>>whole_number; //reads the whole number  from user

   string plural_noun; // string variable that holds the plural_noun value

   cin>>plural_noun; //reads the plural_noun from user

cout<<first_name<<" went to "<< generic_location<<" to buy "<< whole_number<<" different types of "<<plural_noun;} //prints the short story using input values and existing string added with input values

Explanation:

The complete statement is:

If the input is:

Ex: If the input is

Eric

Chipotle

12

cars

Then the output is:  

Eric went to Chipotle to buy 12 different types of cars

Now to complete this program we read the needed values from input, that the existing output statements can use to output a short story.

If you look at the input Eric which is a name can be used as an input value as the name can be different for different users. Chipotle is a location that should aslo be an input value because locations can vary too of different users. 12 is a numeric that can also vary. For example a person can have more than or less than 12 cars. Lastly, cars which is  plural noun can also be used as input value. Now to get the above output we concatenated the input variables with the strings in the print statement in order to output a short story.

You can name the variables whatever you like as i have used different variable names in different programs.

4 0
3 years ago
As it relates to the internet the term “host” means
Alinara [238K]

Answer:

The host, which we also know as the network host, happens to be a computer or any other device which communicates with various other devices that can communicate with various other hosts on a network. And a node is a much broader term that covers everything which is connected to a network. And the host requires an IP address.

Explanation:

Please check the answer section.

7 0
3 years ago
What is the purpose of background music?
FromTheMoon [43]

Answer:

to help focus, or to enhance something you are watching

Explanation:

if you are working on something it helps you think about your assignments or what ever you're working on, if its in a movie ot video or something to be watch it helps set the mood for what is happening

3 0
4 years ago
Read 2 more answers
Other questions:
  • Jerry suspects that information about his internet usage was sent to external websites without his knowledge. He is wary about t
    7·1 answer
  • Match each vocabulary word to its definition.
    8·1 answer
  • Which of the following is NOT a common GUI component? O a. Label b. Button c. Key press d. Text box
    12·2 answers
  • A computer understand..............codes.<br>​
    10·1 answer
  • Do you think it's better for a young designer to use free, open-source art programs or to pay for commercial programs? Explain y
    15·1 answer
  • In what ways can information be slanted in a news report? List at least five ways.
    5·2 answers
  • Which engineer may design a GPS for a vehicle?
    15·1 answer
  • Which of the following actions taken by the Fed will increase the nation’s money supply? (Select all that apply.)
    12·1 answer
  • 19) If you want to find your lowest paid, full time employee (with "FT" in column B and each employee's salary found in column C
    8·2 answers
  • Which native windows application allows you to access basic pc settings and controls such as system information, controlling use
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!