C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 4th, 2014, 08:01 AM
johnnyjallis johnnyjallis is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2014
Posts: 1 johnnyjallis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 34 sec
Reputation Power: 0
Exclamation Need help for a slot machine programing homework

Hello
please i need help for a slot machine code that i am writing , the code i wrote so far gives me dump values when i run it.
thank you for your help

#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <ctime>
char fruit (char);

int main ()
{
int amount;
int totalamount=0;
int choice;
int i;


do {
cout<<"Please enter the amount in dollar you want to bet <zero to exit>: ";
cin>>amount; }
while (amount<0);
if (amount==0)
cout<<"You won the total of $"<<totalamount<<endl;



if (amount>0)
{ {cout<<"["<<fruit<<"] "<<" [######] "<<" [######]"<<endl;
for (i=1;i<=2;i++)

{ cout<<"["<<&fruit<<"] "<<"["<<&fruit<<"]"<<"[######]"<<" "<<"Press 1 to change and 0 to keep"<<endl;

cin>>choice;
if(choice==1)
cout<<"["<<&fruit<<"] "<<"["<<fruit<<"]"<<"[######]"<<" "<<"Press 1 to change and 0 to keep"<<endl;
if(choice==0)
cout<<"["<<&fruit<<"] "<<"["<<&fruit<<"]"<<"[######]"<<" "<<"Press 1 to change and 0 to keep"<<endl;
else
do {cout<<"incorect choice, please enter 1 or 0"<<endl; }
while(choice!=1 || choice!=0); }}


{ cout<<"["<<&fruit<<"] "<<"["<<&fruit<<"]"<<"["<<&fruit<<"]"<<" "<<"Press 1 to change and 0 to keep"<<endl;
cin>>choice;
if(choice==1)

{ cout<<"["<<&fruit<<"] "<<"["<<&fruit<<"]"<<"["<<fruit<<"]"<<" "<<"Press 1 to change and 0 to keep"<<endl;
cout<<"the spin produced the following result: "<<endl;
cout<<"["<<&fruit<<"] "<<"["<<&fruit<<"]"<<"["<<fruit<<"]"<<endl; }

if(choice==0)
{
cout<<"["<<&fruit<<"] "<<"["<<&fruit<<"]"<<"["<<&fruit<<"]"<<" "<<"Press 1 to change and 0 to keep"<<endl;
cout<<"the spin produced the following result: "<<endl;
cout<<"["<<&fruit<<"] "<<"["<<&fruit<<"]"<<"["<<&fruit<<"]"<<endl; }

else
do
{ cout<<"incorect choice, please enter 1 or 0"<<endl;}
while(choice!=1 || choice!=0); }
}




return 0;

}
char fruit (char)
{ char grapes,sherry,orange,banana,kiwi,melon,apple;

enum fruit {grapes,sherry,orange,banana,apple,kiwi,melon};

char fruit= rand() % 7;



return fruit; }

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Need help for a slot machine programing homework


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap