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
Strike441 [17]
2 years ago
8

Define a toString prototype method that returns the cat's name, gender, and age separated by semicolons.

Computers and Technology
1 answer:
nexus9112 [7]2 years ago
6 0

Answer:

Following are the program to this question:

import java.util.*;//import package for user input

public class Main//defining main class

{

public static String Cat (String name, String gender, int age)//defining string method Cat that accept parameter value

{

return name + ';' + gender + ';' + age;//return parameter value

}

public static void main(String[] args) //defining main method

{

   String name,gender;//defining String variable

   int age;//defining integer variable

   System.out.println("Enter name, gender and age: ");//print message

   Scanner obx=new Scanner(System.in);//creating Scanner class object for user input

   name=obx.next();//input name value

   gender=obx.next();//input gender value

   age=obx.nextInt();// input age value

   System.out.println(Cat(name,gender,age));//print return method value

}

}

Output:

Enter name, gender and age:  

dani

Female

12

dani;Female;12

Explanation:

In the above-given code, a string method Cat is declared, that accepts three variable "name, gender, and age", inside the method return keyword is used that returns the parameter values.

In the main method, the above parameter variable is declared, which is used to input value from the user-end, and used the print method to print its return value.

You might be interested in
What are the different methods of enhancing/decorating<br> bamboo product​
Zepler [3.9K]

Explanation:

Methods of this technique include glueing, chemical gilding, and electroplating.  Staining is used to color wood to give an illusion of texture. This may come in two varieties.

7 0
3 years ago
What is ?
FinnZ [79.3K]

<u>Answer:</u>

A. The opening tag for an HTML document

<u>Explanation:</u>

The question was supposed to be What is < html >?

This tag is used as an opening tag for documents that use HTML.

7 0
3 years ago
Read 2 more answers
A small monster collector has captured ten Bagel-type small monsters. Each Bagel-type small monster has a 35% chance of being a
Doss [256]

Answer:

Check the explanation

Explanation:

Each Bagel-type small monster has 0.35 probability of being a Sesame Seed-subtype and 0.2 probability of being a Whole Wheat-subtype.

The probability that exactly 8 of them are Whole Wheat-subtype is \binom{10}{8}(0.2)^8(0.8)^2 using multiplication principle, because first need to choose which 8 are Whole Wheat-subtype, and if exactly 8 of them are Whole Wheat-subtype, then other two are not Whole Wheat-subtype. The former has probability 0.2, while the latter has probability 1-0.2 = 0.8 .

Kindly check the attached images below for the complete answer to the question above

6 0
3 years ago
The best place to search for free (and paid) software for customizing your Hootsuite dashboard to your exact business need is ca
Anastaziya [24]

Answer:

B- App Directory

Explanation:

The best place to search for free (and paid) software for customizing your Hootsuite dashboard to your exact business need is APP DIRECTORY.

An application directory is a group of software code, help files and resources that together comprise a complete software package but are presented to the user as a single object which enable a person to search for free software in other to customize the Hootsuite dashboard to the person business need.

4 0
4 years ago
Write a method minToFront that takes an ArrayList of integers as a parameter and that moves the minimum value in the list to the
Butoxors [25]
The key to this algorithm is to compare each value with its previous value. If the previous value is larger than the current value, change currentVal= previous value and previousVal = currentVal (of course u will need a tempVal to store one of the value). The program should loop from first value til the very end and should only run once.
8 0
3 years ago
Other questions:
  • David would like to send a letter to more than one hundred people. He would like the letter to have names and addresses inserted
    7·1 answer
  • Discussion Question 10: A bank in California has 13 branches spread throughout northern California , each with its own minicompu
    13·1 answer
  • Suppose a data broker correctly identifies that your grandmother is addicted to playing online hearts. From its business intelli
    8·1 answer
  • Complete the paragraph describing characteristics of an audio mixer
    8·2 answers
  • How is the cia triad used to evaluate encryption methods?
    6·1 answer
  • Design a circuit with the following criteria. Assume existence of +5V power supply. Draw your circuit and show your work. i. Inp
    10·1 answer
  • How do you fix The lag on your zsnes emulator
    9·1 answer
  • A company is deploying NAFDs in its office to improve employee productivity when dealing with paperwork. Which of the following
    11·1 answer
  • Write a program that will allow a grocery store to keep track of the total number of bottles collected for a seven-day period. T
    12·1 answer
  • Edit the program provided so that it receives a series of numbers from the user and allows the user to press the enter key to in
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!