wats wrong with this program



#include <stdio.h>
#include <stdlib.h>
#include <iostream.h>
int spp();
int buy();

int main()
{
char name[8];
int sf = 1;
int st = 1;
int sp = 1;
int se = 1;
while(sf+st+sp+se-4>15)
{
cout<<"Enter your name(max 8 char.):";
cin>>name;
cout<<"You have 15 skill points you can add.\n";
cout<<"Increase fighter skills by:";
cin>>sf;
cout<<"Increase trader skills by:";
cin>>st;
cout<<"Increase piolet skills by:";
cin>>sp;
cout<<"Increase engenier skills by:";
cin>>se;
if(sf+st+sp+se-4>15)
{
cout<<"Sorry you have more than 15 points put into your skills.\n";
}
else
{
spp();
}
}
return 0;
}




int spp()
{
int sel;
while (sel>5 || sel<1)
{
cout<<"1. Buy\n";
cout<<"2. Sell\n";
cout<<"3. Shipyard\n";
cout<<"4. Warp\n";
cout<<"5. Exit(game cannot be saved)\n";
cout<<"Enter selection 1, 2, 3, 4 or 5: ";
cin>>sel;
if (sel>5 || sel<1)
{
cout<<"Error! No such input.\n";
}
else
{
}
}
switch(sel)
{
case 1:
buy();
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
exit;
}
return 0;
}

int buy()
{
int bought;
int bays;
int credit=2000;
int pf;
int bse;
cout<<"You can buy food , water, clothes, ore, guns(which are illegal), medicine, machinery and narcotics(which are illegal too).\n";
while (bse>8 || bse<1)
{
cout<<"1. Food 140-200\n";
cout<<"2. Water-160\n";
cout<<"3. Clothes-250\n";
cout<<"4. Ore-500\n";
cout<<"5. Guns-2,500\n";
cout<<"6. Medicine-1,000\n";
cout<<"7. Machinery-3,500\n";
cout<<"8. Narcotics-6,000\n\n";
cout<<"You have ";
cout<<credit;
cout<<" credits.\n\n";
cout<<"Enter selection 1, 2, 3, 4, 5, 6, 7 or 8: ";
cin>>bse;
if (bse>8 || bse<1)
{
cout<<"Error! No such input.\n\n";
}
else
{
}
}
switch(bse)
{
case 1:
{
cout<<"At ";
cout<<pf;
cout<<" credits each, how many would you like to buy:";
cin>>bought;
bought+bays;
if(bought*pf>credit)
{
cout<<"You don't have enough credits.\n";
buy();
}
else
{
if(bays<=15)
{
cout<<bought;
cout<<" canisters of food have been added in your holds.\n";
spp();
}
else
{
cout<<"Sorry, you only have 15 bays.\n";
buy();
}
}
}
break;
case 2:
{
cout<<"How many would You like to buy:";
cin>>bought;
bays+bought;
}
break;
case 3:
{
cout<<"How many would You like to buy:";
cin>>bought;
bays+bought;
}
break;
case 4:
{
cout<<"How many would You like to buy:";
cin>>bought;
bays+bought;
}
break;
case 5:
{
cout<<"How many would You like to buy:";
cin>>bought;
bays+bought;
}
break;
case 6:
{
cout<<"How many would You like to buy:";
cin>>bought;
bays+bought;
}
break;
case 7:
{
cout<<"How many would You like to buy:";
cin>>bought;
bays+bought;
}
break;
case 8:
{
cout<<"How many would You like to buy:";
cin>>bought;
bays+bought;
if(bays>15)
{
cout<<"Sorry, you only have 15 bays.\n";
}
else
{
}
}
break;
}
return 0;
}