Friday, December 16, 2011

Friday 12/16/11

#include
#include

int main()
{
using namespace std;

double area;
cout << "Enter the floor area, in square feet, of your house.";
cout << endl;
cin >> area;
double side;
side = sqrt(area);

cout << "That's the equivalent of a square " << side;
cout << " feet to the side. " << endl;
cout << "How Fascinating!" << endl;
return 0;

}


#include
void simon(int); //function prototype simon()

int main()
{
using namespace std;
simon(3);
cout << " Pick an integer: ";
int count;
cin >> count;
simon(count); //call it again
cout << "Done!" << endl;
return 0;
}

void simon(int n)
{
using namespace std;
cout << "Simon says touch your toes " << n << " times " << endl;
//void functions don't need return statements
}


#include
int stonetolb(int);
int main()
{
using namespace std;
int stone;
cout << "Enter the weight in stone: ";
cin >> stone;
int pounds = stonetolb(stone);
cout << stone << " stone = ";
cout << pounds << " pounds. " << endl;
return 0;
}

int stonetolb(int sts)
{
return 14*sts;
}

No comments: