Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

(Q.) Design and Implement an ADT class Pet for an animal hospital using separate compilation. You are required to write syntactically corret C++ code. Specifically, the animal hospital will consider the following attributes of a pet ( 1) name, (2) age in years, (3) type, which could be one of the following values.: {cat, dog, bird, others} and (4) wieght. Make sure that your ADT class will include the following member function int its interface

(1) A default constructor that initializes all the data members accordingly.

(2) A read-onlaccessor to return the name of a pet

(3) A read-only accessor to return the type of a pet

(4) A mutator to change the weight of a pet

(5) An overloadeded == (equal) operator to compare two pets. This operator will return true if two pets are of the same age and type, false other otherwise. This operator is not allowed to change either of the two participating Pet objects.

(6) An overloaded put operator (<<) as a friend function to print out a pet's information .

(Q.I) Write down the header file pet h . Consise commetns are required.

(Q.2)Implement the following member functions declared in the above header file in diffrent file pet.cpp

//pet.cpp starts here

#include "pet.h"

a) Implement the default constructor using an initializer(i.e., initialization segment). Feel free to choose the initial value of each data member as you see fit.

b)Implement the accessor that returns the name of a pet

c)Implement the overloaded ==(equal) operator

d)Implement the put(<<) operator

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93102472

Have any Question?


Related Questions in Computer Engineering

When using todays digital cameras file sizes are often

When using today's digital cameras file sizes are often saved in a format that is well over 1 Megabyte. This may be great for high definition photo reproductions but is a disaster for uploading to the web. Images on your ...

Research the history of specification languages and write a

Research the history of specification languages, and write a report on the successes or failures of some of these languages. Include 5 languages which are successful and 5 which have failed. All work should be typed writ ...

Submit an annotated bibliography that includes the

Submit an annotated bibliography that includes the following: At least one resource from each of the following categories: Culture-specific information about your own culture Articles about a tradition, value, or belief ...

Case study 1 requirement analysis and gathering for the

Case Study 1: Requirement Analysis and Gathering for the State Firefighters Association Read the mini case on The State Firefighters Association located in Chapter 3 of the textbook and complete the assignment. Write a t ...

Command to mail only the process id of running java program

Command to mail only the process ID of running Java program test to the email address (single line Unix)

A study indicates that the weights of adults are normally

A study indicates that the weights of adults are normally distributed with a mean of 140 lbs and a standard deviation of 25 lbs. Find a value of weight x such that only 20% of adults weigh less than that. A. 136 B.190 C. ...

Why does some workers earn higher wages than others some

Why does some workers earn higher wages than others, some landowners higher rental income than others, and some capital owners greater profit than others? (Example)Why, in particular, do computer programmers earn more th ...

Think about a good or service for which you believe there

Think about a good or service for which you believe there has been a shift in demand or supply. Explain the reasons behind the shift and how that has influenced the equilibrium price.

Question you are responsible for purchasing equipment for a

Question : You are responsible for purchasing equipment for a small business that requires at least 6TB of reliable storage. Research and choose a SAN solution from a major vendor (Dell, HP, EMC, AMAZON etc.). List and d ...

Suppose a finite deck of numeric cards 1 2 3 have been

Suppose a finite deck of numeric cards 1, 2, 3, ... have been shuffled randomly. Repeat the following step: If the top card is numbered 1, the game terminates. But if it is any number n > 1, then reverse the ordering of ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As