Mar 22, 2009 at 11:15pm UTC
This is my first day on this web site and I would be happy to submit this as a .zip file if some one can explain to me how to do that.
I have a problem. I have the entire program working with one exception. Under the RECORDED EVENT, there is an event type that I cannot get to display. I do not know how. I ask for your help. I have spent all day trying to do this even with a binary scope operator to no avail.
1. Below is my .h file. referenced in section A.
2. Below that is my .cpp referenced in section B.
3. Below that is my user file referenced in section C.
A.
#include <iostream>
#include <string>
using namespace std;
class EventBooker
{
private:
// data members
string eventName, eventTime, eventLocation, eventType;
double eventBookingFee;
public:
// constructor
EventBooker ();
//setters
void setEventName (string name);
void setEventTime (string time);
void setEventLocation (string location);
void setEventType (string type);
void setEventBookingFee (double fee);
//void displayForm();
//getters
string getEventName();
string getEventTime();
string getEventLocation();
string getEventType();
double getEventBookingFee();
string getdisplayForm();
//member function
B.
#include <iomanip>
#include <cmath>
#include "EventBooker.h"
EventBooker::EventBooker()
{
displayForm();
}
// setters
void EventBooker::setEventName(string name) {eventName = name;}
void EventBooker::setEventTime(string time) {eventTime = time;}
void EventBooker::setEventLocation(string location) {eventLocation = location;}
void EventBooker::setEventType(string type) {eventType = type;}
void EventBooker::setEventBookingFee(double fee) {eventBookingFee = fee;}
// getters
string EventBooker::getEventName() {return eventName;}
string EventBooker::getEventTime() {return eventTime;}
string EventBooker::getEventLocation() {return eventLocation;}
string EventBooker::getEventType() {return eventType;}
double EventBooker::getEventBookingFee() {return eventBookingFee;}
void EventBooker::displayForm()
{
string input;
double input1;
cout<<"===============> Hot Rod's Booking System <=============== \n\n";
cout<<" Enter the name of the event: \t";
getline(cin, input);
setEventName(input);
cout<<" Enter the time of the event: \t";
getline(cin, input);
setEventTime(input);
cout<<" Enter Location of the event: \t";
getline(cin, input);
setEventLocation(input);
cout<<" Enter the Fees of the event: \t";
cin>>input1;
setEventBookingFee(input1);
if(eventBookingFee>=1 && eventBookingFee<30)
cout<<"10 foot jump"<<endl;
else if(eventBookingFee>=31 && eventBookingFee<40)
cout<<" 20 foot jump"<<endl;
else if(eventBookingFee>=41 && eventBookingFee<60)
cout<<" 20 foot jump with fireworks"<<endl;
else if(eventBookingFee>=61 && eventBookingFee<74)
cout<<" 30 foot jump"<<endl;
else if(eventBookingFee>=74 && eventBookingFee<100)
cout<<" 40 foot jump ofer a pool with ambulance ready"<<endl;
else if(eventBookingFee>100)
cout<<" Price range out of criteria"<<endl;
else cout<<"Error: Invalid entry. Entry out of range \n";
}
void EventBooker::displayEventInformation()
{
cout<<"\n\n\n****************************** EVENT RECORDED ****************************** \n\n";
cout<<" Event Name:\t\t"<<getEventName()<<endl;
cout<<" Event Time:\t\t"<<getEventTime()<<endl;
cout<<" Event Location:\t"<<getEventLocation()<<endl;
cout<<" Event Fees:\t\t $"<<setprecision(2)<<fixed<<getEventBookingFee()<<endl;
cout<<" Event Type:\t\t"<<getEventType()<<endl;
cout<<"\n\n\n ================================================================= \n\n";
}
void displayForm();
void displayEventInformation();
C.
#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
#include "EventBooker.h"
using namespace std;
int main()
{
string input;
EventBooker newEvent;
newEvent.displayEventInformation();
system("pause");
}
};