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]
3 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]3 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
What may happen if there is too much harmony in a design?
Rudiy27

Answer:

B It can seem boring.

Explanation:

The repetition of visual effects results in consistency, rhythm, and movement. However, too much repetition can cause monotony and boredom. And this is not good for you certainly. You are certainly going to lose the audience. And too much harmony in design as well in a similar manner causes boredom, or it can seem boring. And hence, the correct option here is B it can seem boring.

5 0
3 years ago
Networking Gadgets, Inc. currently employs eight people but plans to hire 10 more in the next four months. Users will work on mu
grandymaker [24]

Answer: Server based network

Explanation:

 The server based network is the type of network in which the special type of computer mainly handle the various networking tasks like the storing file, managing printers and authenticate the users in the system. The server based network are also responsible for run various types of application like the email and the database system.

The microsoft windows 2016 and the window 2012 are the two ideal OS (Operating system) that mainly used in the server based network.

Therefore, we use the server based network as it easy to backup and manage in the networking system.

3 0
3 years ago
1. Name the program in which you can draw and colour pictures.​
babymother [125]

Answer:

Photoshop- if this is for school I THINK, but I use Procreate for IOS

Explanation:

4 0
3 years ago
A ___________ variable is declared outside all functions.
velikii [3]

Answer:

B. global

Explanation:

A global variable lives on even when a function returns.

7 0
3 years ago
Drag each tile to the correct box. Shawn has been assigned to create a storyboard for an online grocery website. Organize the st
defon

Answer:  I believe the correct order is:

    Create a box and title it as the “Home Page”  →   Branch out pages and specify navigation flow  →  Gather information such as text and images   →   Determine the title, heading, and content for each page  →   Draw a layout of each web page with its elements.

Explanation:  It makes sense, you start with your "Home Page", then you follow the steps of planning to map out your site's navigation. You have to gather information about it before you have enough knowledge about it to determine the title, heading, and content.  You also need to know the content to create a clean and workable layout for the page.

6 0
3 years ago
Read 2 more answers
Other questions:
  • What tool do you use to secure remote access by users who utilize the internet??
    7·1 answer
  • Write a program that prints the following text: In C, lowercase letters are significant. main() is where program execution begin
    14·1 answer
  • Three of the most important jobs of security management are to ensure _____ are organized according to sensitivity, ensure that
    10·1 answer
  • What is the correct order of headers, from left to right, in a completed frame?
    8·1 answer
  • How do you change the name on your brainly account?
    12·1 answer
  • Which devices typically generate computer output? monitor, printer, speaker, projector, keyboard mouse, printer, speaker, projec
    7·1 answer
  • What are some things all boomers say.
    12·2 answers
  • A task-oriented leader is ideal for a creative workplace.
    8·2 answers
  • GRAND THEFT AUTO 5 LOLLL
    15·2 answers
  • IPv4 and IPv6 are addresses used to identify computers on the Internet. Is this whether true or not:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!