Design a class named pet

Assignment Help C/C++ Programming
Reference no: EM13807348

Design a class named Pet, which should have the following fields:

  • Name - The name field holds the name of a pet.
  • Type - The type field holds the type of animal that is the pet. Example values are "Dog", "Cat", and "Bird".
  • Age - The age field holds the pet's age.

The Pet class should also have the following methods:

  • setName - The setName method stores a value in the name field.
  • setType - The setType method stores a value in the type field.
  • setAge - The setAge method stores a value in the age field.
  • getName - The getName method returns the value of the name field.
  • getType - The getType method returns the value of the type field.
  • getAge - The getAge method returns the value of the age field.

Once you have designed the class, design a program that creates an object of the class and prompts the user to enter the name, type, and age of his pet. This data should be stored in the object. Use the object's accessor methods to retrieve the pet's name, type, and age and display this data on the screen.

You are to submit the following for the assignment:

  • RAPTOR file with the flowchart of  your working program.  Make sure you run it to make sure it is error free and does what it is supposed to do.
  • Use the generate dropdown to create example C++ code based on your working logical flow chart.   Also attached the code in a Microsoft Word file or a text file.

Reference no: EM13807348

Questions Cloud

Theories and concepts of the marketing function : Identifying the key theories and concepts of the marketing function - Identifying the role that manager's play in the marketing function of an organisation.
Refining the target valuation based on new information : Refining the target valuation based on new information uncovered during due diligence is most likely to affect which of the following:
Explain fascism and corporatism are interchangeable : Explain Michael Ruppert's statement, Fascism & Corporatism are interchangeable. Do you agree/disagree
After developing a prospect base-targets are screened : After developing a prospect base, targets are screened (or organized) for contact prioritization. Which of the following can be used for screening criteria? All of the following statements are true about Letters of Intent, except for: The final price..
Design a class named pet : Design a class named Pet, which should have the following fields: Name - The name field holds the name of a pet. and Type - The type field holds the type of animal that is the pet. Example values are "Dog", "Cat", and "Bird"
Acquiring firm assumes all liabilities of the target firm : In a merger, the acquiring firm assumes all liabilities of the target firm. All of the following are true of buyer due diligence except for: Closing is included in which of the following phases of the acquisition process? Integration planning is unde..
Find the future values of an annuity : Find the future values of the following ordinary annuities: FV of $800 paid each 6 months for 5 years at a nominal rate of 6% compounded semiannually.
Present value for various discounting periods : Find the present value of $600 due in the future under each of these conditions: 16% nominal rate, semi annual compounding, discounted back 4 years. 16% nominal rate, monthly compounding, discounted back 1 year.
Future value for various compounding periods : Find the amount to which $500 will grow under each of these conditions: 12% compounded annually for 5 years. 12% compounded quarterly for 5 years.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Perform operations on arrays

Perform operations on arrays execute tests and repetitions

  Prompts the user to enter the mass of a person

Write a program that prompts the user to enter the mass of a person in kilograms and outputs the equivalent weight in pounds. Output both the mass and the weight rounded to two decimal places

  Write a parallel program with the sequent simulator

Complete the following program to write a parallel program with the Sequent Simulator for the following task: Hire two processors. One processor searches the first half of a array and finds the largest number. The second processor searches the sec..

  Summarizing your predicted and actual output

Write a statement summarizing your predicted and actual output, and identify and explain any differences. For your conclusions, write at least one nontrivial paragraph that explains, in detail, either a significant problem you had and how you solv..

  Implement the appropriate methods for big numbers

You must implement each big number as a List of single digits and you must also set up the template class List based on a linked list (use the sample codes). You will need to define and implement the appropriate methods for big numbers.

  Use a loop in main to efficiently handle all three persons

Plan and finish writing the main program, and all the functions, including a constructor. Use a loop in main to efficiently handle all three persons' data.

  Summarize the relationship between classes and unions

Write a paper in which you summarize the relationship between structures, classes, and unions in object-oriented programming.

  Windows application that function like a banking account

Create a Windows application that function like a banking account register. Separate the business logic from the presentation layer. The graphical user interface should allow user to input the account name, number, and balance.

  The program should support a ''new'' feature

Write a GUI program that represents a simple Notepad clone. The program should support a 'new' feature that clears the text buffer, a save feature that writes to a file using a PrintStream

  Floating point values into an array

Write a program that allows a user to enter 10 floating point values into an array. Then, in a loop, the program should prompt the user for a desired precision and subsequently display each value to the correct precision.

  Explain initialize variables counting the lines and letters

If the output file cannot open, exit the program. Initialize variables counting the lines and letters. Write a program that reads a given text file, outputs the text file as is, and also prints the number of lines and the number of times each lette..

  Use a switch statement

Use a switch statement to write a program that prompts user to enter an character.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd