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
saw5 [17]
3 years ago
11

What methods would you add to make this class declarationvery useful?

Computers and Technology
2 answers:
svlad2 [7]3 years ago
6 0

Answer:

void SetAge(int age) , void meow()

Explanation:

Since the class has an itsAge variable as private and has a GetAge() method. There should be a SetAge() method to set the value of the age.

Also, since it is a Cat class, it is better to have a method that mimics the voice of the cat, meow()

sergij07 [2.7K]3 years ago
5 0

Category(int age)- This method is used to declaring the age.

incrementingAge(int age)-This method is used for incrementing  the age.

SettingAge(int age) -This method is used to initializing the age.

These are the three methods for making declaration very useful.

Explanation:

Class Cat

{

public:

Category(int age)

{

itsAge =age;

}

int incrementingAge(int age)

{

itsAge = itsAge+ age;

}

int SettingAge(int age)

{

itsAge =age;

}

int GetAge() const;

private:

         int itsAge;

};Answer:

You might be interested in
Which are the best examples of cost that should be considered when creating a project budget
sashaice [31]

Explanation:

how much the project will cost

5 0
3 years ago
2.Use loops to create a 4X6 matrix in which the value of each element is two times its row number minus three times its column n
DiKsa [7]

Answer:

for(i=0; i<4; i++)

{

      for(j=0;j<6;j++)

      {

               A[ i ][ j ] = 2* i - 3*j;

      }

}

Explanation:

In this loop for each i = 0,1,2,3 we fill the the corresponding column values. and then move to next i value i.e. row.

3 0
3 years ago
2.Consider the following algorithm and A is a 2-D array of size ???? × ????: int any_equal(int n, int A[][]) { int i, j, k, m; f
Elis [28]

Answer:

(a) What is the best case time complexity of the algorithm (assuming n > 1)?

Answer: O(1)

(b) What is the worst case time complexity of the algorithm?

Answer: O(n^4)

Explanation:

(a) In the best case, the if condition will be true, the program will only run once and return so complexity of the algorithm is O(1) .

(b) In the worst case, the program will run n^4 times so complexity of the algorithm is O(n^4).

5 0
3 years ago
Free points ♡
forsale [732]

Answer:

dax and dear god, also my heart hurts

Explanation:

they are great so is he u should listen to him

4 0
3 years ago
Read 2 more answers
Jamal wants to write a program that will find the 10 most common words in Romeo and Juliet. Which of the following constructs wi
arlik [135]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is A: counter module.

Counter module in python or Python counter is a container that holds the count of each of the elements present in the container. It is a sub-class available in the dictionary class. Jamal can use this module in Python to write a program that will find the 10 most common words in Romeo and Juliet.

Other options are not correct because:

While loop: while loop only iterates its body until a specific condition is met. For loop is used to iterate to a pre-specified condition and iterate until the condition is reached. While the mean module of Python is used to calculate mean and average.

6 0
3 years ago
Other questions:
  • Here are the codes for producer and consumer problems.
    10·1 answer
  • Why were mechanical calculators developed?
    8·2 answers
  • A program requires that you change your screen size from 1024 X 728 to 800 X 600. In which of the following locations should you
    7·2 answers
  • What is the value of i printed? j = i = 1 i += j + j * 5 print("What is i?", i)
    11·1 answer
  • Which of the following is NOT a strength of monetary policy?
    15·1 answer
  • To maintain her audience's confidence in her, what should kiara not do while delivering her presentation?
    10·1 answer
  • Which is NOT a benefit of using visual aids?
    9·2 answers
  • Write a program that takes a decimal number from the user and then prints the integer part and the decimal part separately. For
    13·1 answer
  • Which of the following is the BEST reason to use cash for making purchases? everfi
    15·1 answer
  • HELP PLS QUICK TRUE OR FALSE QUESTION
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!