![]() ![]() GetGuess() - prompt the user for their guess. Intro() - displays the introductory text. I see no functions or unsigned variables. You should be using plenty of functions unsigned variables. You have num = rand() % 2 in three different places. The first bet should happen automatically and then you ask if they want to play again. You ask if they want to play once, at the beginning of the program. Write a program that starts a player off with a bank of $15.00 Use the right tool for the job.Ĭhar computer_throw = computer_choice Ĭout << "Computer throws " << computer_throw << '\n' i.e Don't use a for loop and try and convert it to a while loop. If you're writing the same thing twice, you're not leveraging functions or proper logic. Improper logic or improper function arguments/return typeĭuplication of code. Think, how do you win? You win if your guess is = to the coin flip. You will create a permutation of every outcome. Do not check against both heads and tails and this, and that. Global variables ( no00000oooooooooooOOOOOoo! -Darth Vader ) Don't be afraid to use functions to help modularize the parts to this game. Too few functions (This should have at least 3). You should be using plenty of functions, random numbers, decision statements, the while loop(s) (not a do-while loop), unsigned variables, and i/o manipulation at a minimum.Īt the end of the game, ask the user if he/she would like to play again and loop the game with bet input sequence again until the bank reaches 0.00 or the user inputs "n" to quit playing. Note: Do not let the game begin if the user's bank amount is below $1.00. It costs 1 dollar to play and the program will bet that amount automatically each time as long as there is the available bank amount. If the coin flip matches the player's guess his bet will be doubled. A coin will flip and randomly choose heads or tails.The user will guess heads or tails to win. Write a program that starts a player off with a bank of $15.00. #HEADS OR TAILS COIN FLIP CODE#Do I meet the requirements for this assignment? If not, how can I improve the code or make it better? Please help. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |