
Only a few days until presentations... I'm sure we'll be ready by then. We'd probably be ready now, but a little less prepared. Though, our current trend of presenting has been to wing it.
onClipEvent(enterFrame){
if(this.hitTest(_root.player.head)){
_root.player._y = this._y + 14;
}
}
on(release){
fscommand("quit");
}
int main()
{
char firstname[50];
cout<<"Please enter your first name: ";
cin.getline ( firstname, 50 );
int main()
{
database employee;
employee.age = 22;
employee.id_number = 543927;
employee.salary = 12000.21;
#include
using namespace std;
int main()
{
int x;
int y;
int array[50][50];
for ( x = 0; x < 50; x++ ) {
for ( y = 0; y < 50; y++ )
array[x][y] = x + y;
}
cout<<"Array Indices:\n";
for ( x = 0; x < 50; x++ ) {
for ( y = 0; y < 50; y++ )
cout<<" "<< array[x][y] <<" ";
cout<<"\n";
}
cin.get();
system("\n pause");
}
What happens is you enter a number between 1-4 and whatever one you choose, it will run that case. If you pick something other than that, it will display a default message. Currently, I've gotten the cases to work, but the default doesn't work. Another problem is that the message (ie. You chose 4) doesn't stay. It quickly displays and then the window closes. That should be easily solved, but I didn't have time to solve it because...
switch ( input ) {
case 1:
cout<<"You chose 1.";
break;
case 2:
cout<<"You chose 2.";
break;
case 3:
cout<<"You chose 3.";
break;
case 4:
cout<<"You chose 4.";
break;
default:
cout<<"Why can't you follow directions?";
break;
}
#include
using namespace std;
int mult ( int x, int y );
int main()
{
int x;
int y;
cout<<"Please input two numbers to be multiplied: ";
cin>> x >> y;
cin.ignore();
cout<<"The product of your two numbers is "<< mult ( x , y ) <<".\n";
cin.get();
}
int mult (int x, int y )
{
return ( x * y );
}
This program, which is an example from the tutorial, asks you for two numbers and multiplies them. A very basic example of functions.