Starting Out with Programming Logic and Design (4th Edition)
Starting Out with Programming Logic and Design (4th Edition)
4th Edition
ISBN: 9780133985078
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 6, Problem 12PE
Program Plan Intro

Slot Machine Simulation

Program Plan:

  • Include the required import statement.
  • Define the main class.
    • Define the main method using public static main.
      • Declare and set the array variable.
      • Get the input from the user.
      • Add the “mentered” value with the user input.
      • Generate the random number.
      • Set the value and print the images.
      • If “r1”, “r2” and “r3” are equal, multiple 3 with “mentered”.
        • Display the result.
      • If any of the three variable are equal then multiple 2 with “mentered”.
        • Display the result.
      • Otherwise multiple 0 with “mentered”.
        • Display the result.
      • Get the user response from the user whether he has to continue or not.
      • Finally display the result.

Blurred answer
Students have asked these similar questions
Slot Machine SimulationA slot machine is a gambling device that the user inserts money into and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money that the slot machine dispenses back to the user. Create a program that simulates a slot machine. When the program runs, it should do the following: Asks the user to enter the amount of money he or she wants to enter into the slot machine. Instead of displaying images, the program will randomly select a word from the following list: Cherries, Oranges, Plums, Bells, Melons, Bars To select a word, the program can generate a random number in the range of 0 through 5. If the number is 0, the selected word is Cherries; if the number is 1, the selected word is Oranges; and so forth. The program should randomly select a word from this list three times and display all three of the words. If none of the randomly selected words match, the…
Slot Machine Simulation- I need to get answer in Pseudocode A slot machine is a gambling device that the user inserts money into and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money, which the slot machine dispenses back to the user. Design a program that simulates a slot machine. When the program runs, it should do the following: Ask the user to enter the amount of money he or she wants to insert into the slot machine. Instead of displaying images, the program will randomly select a word from the following list: Cherries, Oranges, Plums, Bells, Melons, Bars The program will select and display a word from this list three times. If none of the randomly selected words match, the program will inform the user that he or she has won $0. If two of the words match, the program will inform the user that he or she has won two times the amount entered. If three of the words…
In C# language using Microsoft Visual Studio in Windows Forms App (.NET Framework) A slot machine is a gambling device that the user inserts money into and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money, which the slot machine dispenses back to the user. Design a program that simulates a slot machine. When the program runs, it should do the following: Ask the user to enter the amount of money he or she wants to insert into the slot machine. Create an application that simulates a slot machine.   The application should let the user enter into a TextBox the amount of money he or she is inserting into the machine. When the user clicks the Spin button, the application should display three randomly selected symbols. (Slot machines traditionally display fruit symbols.

Chapter 6 Solutions

Starting Out with Programming Logic and Design (4th Edition)

Ch. 6 - This part of a function definition specifies the...Ch. 6 - This part of a function definition is comprised of...Ch. 6 - In pseudocode, this statement causes a function to...Ch. 6 - This is a design tool that describes the input,...Ch. 6 - This type of function returns either True or...Ch. 6 - This is an example of a data type conversion...Ch. 6 - Prob. 9MCCh. 6 - Prob. 10MCCh. 6 - The code for a library function must appear in a...Ch. 6 - Prob. 2TFCh. 6 - In many languages it is an error to assign a real...Ch. 6 - In some languages you must use a library function...Ch. 6 - Prob. 5TFCh. 6 - What is the difference between a module and a...Ch. 6 - Prob. 2SACh. 6 - Prob. 3SACh. 6 - Prob. 4SACh. 6 - Prob. 5SACh. 6 - Prob. 6SACh. 6 - As shown in this chapter, write a pseudocode...Ch. 6 - The following pseudocode statement calls a...Ch. 6 - A pseudocode program contains the following...Ch. 6 - Design a pseudocode function named timesTen that...Ch. 6 - Design a pseudocode function named getFirstName...Ch. 6 - Assume that a program has two String variables...Ch. 6 - The programmer intends for this pseudocode to...Ch. 6 - Can you find the reason that the following...Ch. 6 - Can you find the reason that the following...Ch. 6 - Feet to Inches One foot equals 12 inches. Design a...Ch. 6 - Math Quiz Design a program that gives simple math...Ch. 6 - Maximum of Two Values Design a function named max...Ch. 6 - Falling Distance When an object is falling because...Ch. 6 - Kinetic Energy In physics, an object that is in...Ch. 6 - Test Average and Grade Write a program that asks...Ch. 6 - Odd/Even Counter In this chapter you saw an...Ch. 6 - Prime Numbers A prime number is a number that is...Ch. 6 - Prime Number List This exercise assumes you have...Ch. 6 - Rock, Paper, Scissors Game Design a program that...Ch. 6 - Prob. 12PE
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning