I have to do two exercises out of my textbook which work fine but I have to display a banner before doing the exercises
//March 19, 2008
//Exercise 5.23 and 5.24
//Project 1
#include <iostream>
using std::cout;
using std::endl;
using std::cin;
int main()
{
cout<<"Project 1"<<endl;
cout<<"name"<<endl;
cout<<"March 19, 2008"<<endl;
cout<<"Computer Science 111-003"<<endl;
cout<<"Exercise 5.23 and 5.24"<<endl;
cout<<endl;
void print (int any);
int any;
do{
cout<<"Please type in a positive odd integer: ";
cin>>any;
while((any%2==0)||(any<=0));
print(any);
return (0);
}
void print(int any)
{
int spaces=any/1, size=1, counter, count;
for(counter=0;counter!=(any+1)/2;counter++){
for(count=spaces;count>0;count--)
cout<<" ";
spaces--;
for(count=size;count>0;count--)
cout<<"*";
size+=2;
cout<<endl;
}
size=any-2;
spaces+=2;
for(counter=any/2;counter>0;counter--){
for(count=0;count!=spaces;count++)
cout<<" ";
spaces++;
for(count=size;count>0;count--)
cout<<"*";
size-=2;
cout<<endl;
}
system ("PAUSE");
}