Creating a simple slot machine using c programming

Assignment Help C/C++ Programming
Reference no: EM132084494

Objective - creating a simple slot machine.

1. The machine should ask the user how much money he/she is willing to Deposit.

2. The machine should ask the user how much money he/she is willing to Bet per each round.

3. The slot machine will display 3 numbers 0, 1, and 2.

4. The choice of these numbers should be decided by rand() function in c.

[How to use rand() function in c a. Num=rand()%3; //This line will generate a number between 0, 1, and 2 and assign the number to Num variable b. rand() requires #include <stdlib.h>

5. The choice of these 3 numbers should be computed outside of main() function - in other words, use the USER defined function.

6. Each round, the Deposit will be deducted by the amount of the Bet

7. When first two numbers match, the user will receive x1 of the Bet

8. When all three numbers match, the user will receive x2 of the Bet. *So, conditions 6, 7, and 8 express the rule of gambling. No matches, you will lose the Bet money (Deposit - Bet) First two numbers match, you will break even (Deposit - Bet + Bet) When 3 numbers match you make some (Deposit - Bet + 2 x Bet)

9. After each round, the user should be prompted whether he/she would like to play more.

10. If the Deposit money runs out, the game should end automatically.

Code in C

Reference no: EM132084494

Questions Cloud

What are some factors that might counter this interpretation : On what grounds might they make this claim, and to what extent do you think this interpretation is accurate?
Write a program that allows the user to enter a tax bracket : How much higher the interest rate must be depends on the investor's tax bracket. Write a program that allows the user to enter a tax bracket .
What were the goals of adolph hitler as laid out : What were the goals of Adolph Hitler as laid out in Mein Kampf? What were the ideological roots of the Nazi Party, and what kind of goals did the party
Discuss about the structured design : When an object-oriented design proceeds to the implementation stage, it is possible that some operations listed in the object table will be implemented.
Creating a simple slot machine using c programming : The machine should ask the user how much money he/she is willing to Bet per each round.
How does the os manage processes : How does the OS manage processes? Be able to name five OS management activities related to processes.
Learn and use bitwise operations within a program : Can find a partner in your class so you can work together to finish the homework. You don't necessarily need to meet each other in face.
Do research and write a paper on structured analysis : Nassi-Shneiderman structure charts (yes, that's Ben Shneiderman, before he became famous for his work in HCI).
What kind of problems faced the german government : What kind of problems faced the German government between 1919 and 1925? How did the way the war ended contribute to the weakness

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Describe your experiences on writing your first c program

Describe your experiences on writing and testing your first C program. Gives examples of where you got stuck?. What difficulties you faced? What did you learn from this experience?

  Create a linked list of self referential structures

CS1325 - F16 Assignment: Create a linked list of self referential structures (each self referential structures is called Student) and initialize the list to empty. Take the strings from String[] and the GPA from GPA[] one by one.

  Display the equivalent prices

Test your application with 1.259 per liter against 4.50 per gallon. Once the decision is made, display the equivalent prices. (1 liter is 0.264172 gallons)

  Write Relational Algebra queries

Attributes cid and fid in Reservation are foreign keys referencing homonymous attributes in Customer and Flight, respectively. Write Relational Algebra queries

  Computes the total cost of the purchase

Code a program that asks for the number of units purchased and computes the total cost of the purchase.

  Program that opens a file representing an encoded maze

Write a C++ program that opens a file representing an encoded maze and reads it in properly so it can be analyzed.

  Prepare a set of uml class relationship diagrams

Give an initial list of candidate classes and responsibilities and give an initial set of CRC cards -  Prepare a set of 3 UML class relationship diagrams highlighting important relations among the discovered classes.

  Wap that will search a binary file of numbers of type int

Write a program that will search a binary file of numbers of type int and write the largest and the smallest numbers to the screen.

  Many bank atm machines have recently added the ability to

many bank atm machines have recently added the ability to dispense cash with- drawals in multiple bill denominations

  Write program on book a hotel room

Book a hotel room: Prompt the user for their name. If the name is found, display the GuestNos and Addresses for all matches. If the name is not found, prompt the user for their address and insert a new record; display the GuestNo

  Write a function that accepts an int array

The task calls for: Write a function that accepts an int array and the array's size as arguments. The function should create a copy of the array, except that the element values should be reversed in the copy. The function should return a pointer t..

  Recursive function returns number of vowels in a string

Write a recursive function, vowels, that returns the number of vowels in a string and write a program to test your function.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd