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
Aleonysh [2.5K]
2 years ago
13

Write a class "Dog" with a private int field called months and two public member functions setAge and GetStage. setAge takes as

argument monthsToSet and sets the member field months. setAge returns void. getStage is a const member function that takes no argument and returns a string "Puppy" if the dog is less than 9 months old, "Adolescence" if more than 9 and less than 13 months, "Adulthood" if more than 13 and less than 60 months and "Senior" otherwise. The main should create a Dog called Buddy, set its age to 14 and cout the string returned by GetStage.

Computers and Technology
1 answer:
expeople1 [14]2 years ago
3 0

Answer:

see explaination

Explanation:

#include <iostream>

using namespace std;

class Dog {

int months;

public:

void SetAge(int mnths);

string GetStage() const;

//FIXME: Add declarations of member functions and fields

};

//FIXME: Add definitions of member functions

void Dog::SetAge(int mnths)

{

months = mnths;

}

string Dog::GetStage() const

{

if(months<9)

return string("Puppy");

else if(months<13)

return string("Adolescence");

else if(months<60)

return string("Adulthood");

else

return string("Senior");

}

int main() {

Dog buddy;

buddy.SetAge(14);

cout << buddy.GetStage();

return 0;

}

See attachment for screenshot and output.

You might be interested in
Just help :(((((((((((((((((((((((((((((((((((
saveliy_v [14]

Answer:

I am sure the answer is A

Explanation:

As you can see from the graph, the first time they pumped air, the numbers were 6, 1.2, and 2. Once they start pumping the numbers decrease. Therefore, I think the answer is A. It went to 5.7, 4, and 2 from 6, 1.2, and 2.1.

5 0
2 years ago
Read the two sentences below. Then select the response that best describes the verb tense used in the sentences.
N76 [4]
I would say A because it was talking about something in the present but what they were talking about was in past. so I would think A
6 0
3 years ago
What special signal is issued periodically from an Access Point and contains the network transmission rate and service set ident
olya-2409 [2.1K]

Answer:

beacon frame  

Explanation:

Beacon frame is a management frame In computer networks, known to be in IEEE 802.11 based WLANs. These frames are transmitted periodically and they contain all the  information a station will require before it can rightly transmit a frame.  

When it comes to announcing the presence of devices in a wireless computer network (WLAN), Beacon frames are used, and they can also be used in the synchronization of the devices and services

6 0
2 years ago
What is the most useful advantage of social media in an emergency response effort?
gladu [14]
Being able to communicate directly with constituents.

ability to build situational awareness speed in which information can be delivered directly to the public
4 0
3 years ago
Which of the following is CORRECT about database managementsystem's languages?
scZoUnD [109]

Answer:

Data manipulation languages are used for the retrieval of the,insertion,deletion and modification of data.

Explanation:

Data Manipulation Languages(DML) are used to insert,delete,update,modify the data in the database.

The commands used to do these operations are as following:-

INSERT INTO :-This command is used to insert values in the database.

DELETE:-It is used to delete existing records from the table.

UPDATE:- It is used to modify the records in the table.

SELECT:- It is used to select data from database.

3 0
3 years ago
Other questions:
  • Match the challenge with the term or process that offers a solution.
    6·1 answer
  • In the writing process, after you ve narrowed down your topic, you can use the _______ technique to view a topic from different
    9·2 answers
  • A project manager type a document and print it he is using
    14·1 answer
  • I can't find the errors! Could anyone help me please?!
    5·1 answer
  • In this lab, you will build a system for package delivery services that provides different shipping options with specific price.
    6·1 answer
  • How does an individual's access to a wide range of online services affects their ability to operate safely in the digital world.
    5·1 answer
  • Which situations are better suited to an indefinite (while) loop? Select 3 options.
    5·2 answers
  • .....is used to save project in Visual basic .net from file menu
    6·1 answer
  • Why is the Microsoft website considered the best source for information about pagefile.sys?​
    15·1 answer
  • What steps can you take to secure your private information?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!