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
ExtremeBDS [4]
3 years ago
9

Write a class for a Cat that is a subclass of Pet. In addition to a name and owner, a cat will have a breed and will say "meow"

when it speaks. Additionally, a Cat is able to purr (print out "Purring..." to the console).
Computers and Technology
1 answer:
fenix001 [56]3 years ago
8 0

Answer:

The Java class is given below with appropriate tags for better understanding

Explanation:

public class Cat extends Pet{

  private String breed;

 public Cat(String name, String owner, String breed){

      /* implementation not shown */

      super(name, owner);

      this.breed = breed;

  }

  public String getBreed() {

      return breed;

  }

  public void setBreed(String breed) {

      this.breed = breed;

  }

  public String speak(){ /* implementation not shown */  

      return "Purring…";

  }

}

You might be interested in
The concurrent process model defines a set of "states." describe what these states represent in your own words, and then indicat
nikitadnepr [17]

Answer:

Explanation:

Concurrent Process model can be regarded as evolutionary process model as well as software engineering is concerned, it allows to know the current state of activities as well as their associated states.

The set of states In the concurrent process model are:

✓awaiting changes

✓Inactive

✓baselined

✓under development

✓under revision

✓under review

✓done

The stated "states" above give a representation of externally observable mode as regards to the behaviour of activities of a particular software engineering.

The existence of activities of software engineering do exist at same period

In concurrent process model, though each of the activities occur in different states so that process network is produced. The movement from one state to another of activity of software engineering is as a result of

predefined events.

5 0
3 years ago
Write a program that takes user input describing a playing card in the following short-hand notation:
siniylev [52]

Answer:

In python Language:

cardNotation = raw_input("Enter card notation: ")

 

# Create a dict for values

 

cardColors = {"D": "Diamonds",

             "H": "Hearts",

             "S": "Spades",

             "C": "Clubs"}

 

cardNumberValues = {"A": "Ace",

                   "J": "Jack",

                   "Q": "Queen",

                   "K": "King",

                   "2": "Two",

                   "3": "Three",

                   "4": "Four",

                   "5": "Five",

                   "6": "Six",

                   "7": "Seven",

                   "8": "Eight",

                   "9": "Nine",

                   "10": "Ten"}

 

# Handle cases when 10 comes in input

if len(cardNotation) == 3:

 

   number = cardNotation[:2]

   color = cardNotation[2:]

   print cardNumberValues.get(number) + " of " + cardColors.get(color)

 

elif len(cardNotation) == 2:

 

   number = cardNotation[:1]

   color = cardNotation[1:]

   print cardNumberValues.get(number) + " of " + cardColors.get(color)

 

else:

   print "INVALID VALUE"

6 0
3 years ago
Discuss Batch Processing clearly showing the advantages and disadvantages
vazorg [7]

Answer:

Batch Processing is the processing of previously collected jobs in a single batch.

Explanation:

Some advantages would be that a data center's staff can schedule batch processing during times when the computers are otherwise idle, such as overnight, The computer operators can delay or prioritize different batches easily, and computer files containing commands, programs and data; once created, some can be run repeatedly as needed, adding convenience for the staff and helping keep processing costs low.

Some disadvantages would be that all of a batch job's input data must be ready before the computer can run it, problems with data, errors and program crashes that occur during batch jobs bring the whole process to a halt, and the inputs must be carefully checked before the job can be run again.

https://www.techwalla.com/articles/advantages-disadvantages-of-batch-processing

5 0
3 years ago
Number of megabytes of RAM in a computer. qualitative or quantitative? because
Mandarinka [93]

Answer:

The answer is "The variable is quantitative because it is numerically measured"

Explanation:

RAM is seen as a volatile memory, that doesn't have power the stored information is lost. But, whenever a CPU runs the RAM to store information needed for use very quickly and does not perpetually store certain information, the central processing system (CPU) uses RAM.

  • RAM process the data into bytes, in which megabytes (MB) are its higher process value.
  • All the value is countable in its numeric form, that's why the quantitative is the correct answer.
8 0
3 years ago
A prime number is a number that is divisible only by itself and 1. Write a program that asks a user for an integer value and the
Rashid [163]

Answer:

The Solution Code is written in Java.

  1. public class Main {
  2.    public static void main(String[] args) {
  3.        System.out.print("Please enter an integer: ");
  4.        Scanner input = new Scanner(System.in);
  5.        int number = input.nextInt();
  6.        System.out.print("Prime numbers less than or equal to " + number + " : ");
  7.        for(int i=2; i <= number; i++){
  8.            if(checkPrime(i)){
  9.                System.out.print(i + " ");
  10.            }
  11.        }
  12.    }
  13.    public static Boolean checkPrime(int num){
  14.        for(int i=2; i < num; i++)
  15.        {
  16.            if(num % i == 0){
  17.                return false;
  18.            }
  19.        }
  20.        return true;
  21.    }
  22. }

Explanation:

Firstly, we create a function to check if a number is prime (Line 18 - 27).

  • This function will take one input value which is an integer, num.
  • To check if the input num is a prime, we can use modulus operator, %, to confirm if the num is divisible by any number starting from 2 to num - 1 (Line 19 - 24).
  • If the num is divisible by any number expect 1 and itself, it should equal to zero and return false to indicate it is not a prime number.
  • If all the num (except 1 and itself) is not divisible, the function will return true (Line 25).

Next, in our main program part (Line 3 - 16)

  • Prompt the user to input a number (Line 5 - 7)
  • Using a for-loop, we can keep calling the checkPrime() function by passing a current number (starting from 2 to input number) as argument (Line 12). The checkPrime() function will run and return true it the current number is prime, return false if it is not prime.
  • If the checkPrime() function return true, it will print the current number before proceed to the iteration of the for-loop to repeat the same check prime procedure (Line 13)
  • At the end all the prime numbers less than or equal to the input number will be printed out in the terminal
8 0
3 years ago
Other questions:
  • In which of the following scenarios would you use the Redo function?
    9·1 answer
  • Universal Containers has a requirement to integrate Salesforce with an external system to control record access.
    12·1 answer
  • Justine was interested in learning how to play the piano. Before she was allowed to even play the piano, she has had to learn
    15·2 answers
  • Which statement describes the relationship between science and technology?
    13·2 answers
  • WHAT IS ONE WAY A PIVOTTABLE COULD COMBINE THE FOLLOWING DATA
    10·1 answer
  • Which of these number formats would you want to apply to a cell showing the total sales for the month? Currency, Number, or Perc
    10·2 answers
  • The best presentations try to include as much text as possible on each slide true or false ​
    13·1 answer
  • What term is used to describe the process of monitoring operating results and comparing actual results with the expected results
    9·1 answer
  • Short notes on primary key​
    6·1 answer
  • Which two features could be added to a game using an "if () then " block
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!