Question: C++ question and a code snippet is needed not the whole program 1. Write code for each of the following: a. Define a class called

C++ question and a code snippet is needed not the whole program

C++ question and a code snippet is needed not the whole program

1. Write code for each of the following: a. Define a class called Horse that will contain the following data: Name - string that can contain spaces Weight contains a integer number .Price paid can contain a decimal number and have the following prototypes: Default constructor Constructor that takes name, weight, and price paid Output-a function that will print out all of the information in the class b. Write code for each of the functions. Assume that the code is written outside the class definition. Default constructor set fields that contain numbers to 0 and fields that contain strings to a blank Constructor that takes name, weight, and price paid set data appropriately Output- a function that will print out all of the information in the class c. Write a main function that will use both of the constructors and call the output function. You don't need to provide include files

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!