i wrote this code for sending and recieve mail but i can't get the output that is required for class
which is -Test 1--
Creating a new envelope
Addressing from Muffin To Howie
Inserting the message: Pet me!
Affix Postage: 0.33 stamp
Sealing the envelope
Mailing the envelope
--Test 2--
Creating a new envelope
Addressing from Howie To Muffin
Inserting the message: Go Play In Traffic!
You Silly, You Can't Mail Without Postage And Sealing The Envelope First!
--Test 3--
Creating a new envelope
Addressing from Howie To Muffin
Inserting the message: Be A Good Doggie!
Sealing the envelope
You Silly, You Can't Mail An Envelope Without Postage

#include <iostream>
#include<string>
using namespace std;
class Envelope
{
public:
void address( string to, string from );
void affixPostage( double amount );
bool hasPostage();
void insertLetter( string message ); 
void seal( );
void mail( );   


private:
string my_fromField, my_toField;
double my_Postage;
string my_Letter;
bool my_isSealed;

};

{ 
Envelope( );

void address( string to, string from );
void affixPostage( double amount );
bool hasPostage();

void insertLetter( string message ); 

void seal( );
void mail( );
string my_fromField, my_toField;
double my_Postage;
string my_Letter;
bool my_isSealed;
cout << "--Test 1--" << endl;
Envelope e;
e.address( "Howie", "Muffin" );
e.insertLetter( "Pet me!" );
e.affixPostage( 0.33 );
e.seal( );
e.mail( );

cout << "--Test 2--" << endl;

Envelope f;
f.address( "Muffin", "Howie" );
f.insertLetter("Go Play In Traffic!");
f.mail( );

cout << "--Test 3--" << endl;
Envelope g;
g.address( "Muffin", "Howie" );
g.insertLetter("Be A Good Doggie!");
g.seal( );
g.mail( );
return 0;
}

Where's the int main() entry function?

You have to include the constructor for your class under public.

Where's the code for the functions in your Envelope class? You either didn't include the code or you didn't write them.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.