Newbie help: Add a new record to a database
Posted: 2002-06-01
By: ArchiveBot
Viewed: 94
Filed Under:
No attachments for this post
Simple form to insert a value into a table using ADO's RecordSet.AddNew.
Name this form:addnew.ASP
Original Author: Found on the World Wide Web
Code
//Kevin Pre$a
#include
#include
#include
int main(void)
{
clrscr();
int t=100;
int pull=1;
do{
cout<<"You have "<
if (pull==1)
t=t-1;
while (pull==1){
random;
int a=random(3)+1;
random;
int b=random(3)+1;
random;
int c=random(3)+1;
random;
int win=random(100)+1;
cout<<"["< if ((a==b) && (b==c) && (a==c))
cout<<"You won: "<
{
cout<<"You lost: "<<(int)(win/10)<<" tokens";
t=t-(int)(win/10); //Note that the division is to prevent it
//from working like a real slot machine
//That is, the user loses all of his or her
//money in a short amount of time.
}
if ((a==c) && (b==a) && (b==c))
t=t+win;
cout<
}
}while (pull==1);
cout<<"Thanks for playing slot machine. Press any key to quit Slot Machine";
getch();
return(0);
}
Comments on this post
No comments have been added for this post.
You must be logged in to make a comment.