Pardon the mess. Program works, 1 annoying thing is the divider1, always runs into the Attendance Report. All the other dividers behave normally. I tried just using a cout for the "Attendance Report", then moved it to a void/void, and that one divider does the same thing in each case. Thanks for any help, I'm sure it's something very simple....
Code:
#include <iostream>
#include <iomanip>
//#include <string>
using namespace std;
//constants and voids
const int SCREEN_WIDTH = 70;
const char BLANK = ' ';
void PrintWelcome (void);
void PrintWelcome2 (void);
void Divider1 (void);
void Divider2 (void);
int main (void)
{
int NumberOfVisitors;
int CMorn;
int CAft;
int CTot;
int CPer;
int FMorn;
int FAft;
int FTot;
int FPer;
int RMorn;
int RAft;
int RTot;
int RPer;
int TotalMorn;
int TotalAft;
int GrandTot;
int TotalMorning;
int TotalAfternoon;
int GrandTotal;
PrintWelcome ();
//cout << setw(52) << "Aaron's Amusement Park" << endl;
//cout << endl;
Divider1 () ;
cout << endl;
//cout << setw(52) << "Attendance Report" << endl;
PrintWelcome2 ();
cout << endl;
Divider1 () ;
cout << endl;
cout << "Enter the number of visitors at the park : ";
cin >> NumberOfVisitors ;
if ( NumberOfVisitors > 0)
cout << "good" << endl;
else cout << "error";
Divider2 ();
cout << "For Ride #1, The Carousel:" ;
cout << endl;
cout << "Morning Riders: " ;
cin >> CMorn;
cout << endl;
cout << "Afternoon Riders" ;
cin >> CAft;
cout << endl;
CTot = CAft + CMorn;
cout << "Total Riders: " << CTot ;
CPer = (CTot / double(NumberOfVisitors)) * 100;
cout << "Percent of Riders: " << CPer ;
cout << endl;
Divider2 ();
cout << "For Ride #2, The Ferris Wheel:" ;
cout << "Morning Riders: " ;
cin >> FMorn;
cout << endl;
cout << "Afternoon Riders" << endl;
cin >> FAft;
cout << endl;
FTot = FAft + FMorn;
cout << "Total Riders: " << FTot ;
FPer = (FTot / double(NumberOfVisitors)) * 100;
cout << endl;
cout << "Percent of Riders: " << FPer ;
cout << endl;
Divider2 ();
cout << "For Ride #3, The Roller Coaster:" ;
cout << "Morning Riders: " << endl;
cin >> RMorn;
cout << "Afternoon Riders" << endl;
cin >> RAft;
RTot = RAft + RMorn;
cout << "Total Riders: " << RTot ;
RPer = (RTot / double(NumberOfVisitors)) * 100;
cout << "Percent of Riders: " << RPer ;
TotalMorning = CMorn + FMorn + RMorn;
TotalAfternoon = CAft + CMorn + RMorn;
GrandTotal = TotalMorning + TotalAfternoon;
cout << "Total Morning Riders: " << TotalMorning ;
cout << "Total Afternoon Riders: " << TotalAfternoon ;
cout << "Grand Total Riders: " << GrandTotal;
cout << endl;
Divider2 ();
return 0;
}
void PrintWelcome (void)
{
cout << setw(52) << "Aaron's Amusement Park";
cout << endl ;
}
void PrintWelcome2 (void)
{
cout << setw(52) << "Attendance Report";
cout << endl;
}
void Divider1 (void)
{
cout << setfill ('=');
cout << setw(SCREEN_WIDTH) << BLANK << endl;
}
void Divider2 (void)
{
cout << setfill ('-');
cout << setw(SCREEN_WIDTH) << BLANK << endl;
}