I am working on a class project that I'm stuck on the next step and need a little boost.I have included the direction for this, so you can see where I'm stuck along with my existing code. I'm not asking fo project to be finished. i just ned a little help with cascading ostream Thanks.
//Program (50 points)
//
//43. Create a program meeting the following requirements:
//1. It has a class called Instrument
//2. The class has an overloaded friend stream insertion operator that does the following:
//a. Outputs the instrument Name
//b. Outputs the number of instruments in the band if there are more than zero
//c. Returns the ostream object as a reference to allow cascading
//3. The class has an overloaded friend stream extraction operator that does the following:
//a. Prompts the user to enter the number of instrument’s in the band by the specific Name
//b. Stores the value in the class data member
//c. Returns the istream object as a reference to allow cascading
//4. The class has a public default constructor with a 25 character parameter that does the following:
//a. Defaults the instrument Name to “Saxophone” if another value is not passed in
//b. Dynamically allocates an array of 25 characters
//c. Copies the value passed in to the class’ data member
//d. Initializes the NumberInBand data member to zero
//5. The class has a private character pointer called Name and a private integer called NumberInBand.
//6. In main create two objects and pass “Coronet” into one and let the other be defaulted. Then cout both objects, cin both objects, and then cout both objects again. Use cascading to do this.
//7. The output should look exactly as shown below except for the numbers input by the user.
//
//Instrument Name: Saxophone
//Instrument Name: Coronet
//Enter the number of Saxophone's in the band: 4
//Enter the number of Coronet's in the band: 6
//Instrument Name: Saxophone
//Number in band: 4
//Instrument Name: Coronet
//Number in band: 6
CODE
#include <iostream>
#include <iomanip>
using namespace std;
class Instrument
{
friend ostream &operator<< (ostream&, Instrument&);
friend istream &operator>> (istream&, Instrument&);
public:
Instrument();
Instrument(Instrument *);
private:
};//end of class