I just started c++ the other day and I can't get the program to load, I didn't bother to do the whole code because if this part doesn't work, then what's to stop me to make the same mistake through the whole program?
Code:#include <iostream.h>
#include <stdlib.h>
float Health();
float Attack();
float Defense();
float Spider();
int main()
{
cout<<"Welcome to the Battle Arena!\n"<<endl;
}
float Health()
{
float x;
x = 1 + rand() % 5;
if (x >= 20)
return 15;
else
return x;
cout<<"Your starting Health is: \n"<<Health;
}
float Defense()
{
float y;
y = 5 + rand();
if (y > 20)
return y;
else
return 20;
{
cout<<"Your starting Defense is: \n"<<Defense;
}
cout<<"Your first Enemy is the poison Spider!\n"<<endl;
float Spider();
{
float a;
a = 5 + rand();
if (a > 10)
return 7;
else
return 5;
}
{
cout<<"Spider's Health is: \n"<<Spider;
cout<<"Attack?\n"<<endl;
}
}
