C Sharp, having an issue with the spin button and displaying the images. See Pics   using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO; using System.Net.Http.Headers; using System.Web;   namespace Slot_Machine {        public partial class Form1 : Form     {         //Create a Random object          Random rand = new Random();         //Create an image[] = the URL to the images.          private Image[] images = new Image[]         { Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Apple.bmp"),           Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Banana.bmp"),           Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Grapes.bmp"),           Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Cherries.bmp"),           Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Lemon.bmp"),           Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Lime.bmp"),           Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Orange.bmp"),           Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Pear.bmp"),           Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Strawbwerries.bmp")         }; public Form1()         {             InitializeComponent();         }         //Create a random method          void RandomPicutes()         {             pictureBox1.Image = images[rand.Next(0, images.Length)];             pictureBox2.Image = images[rand.Next(0, images.Length)];             pictureBox3.Image = images[rand.Next(0, images.Length)];         }         int FriutMactches()         {             int matches = 1;             if (pictureBox1.Image == pictureBox2.Image) ++matches;             if (pictureBox2.Image == pictureBox3.Image) ++matches;             return matches;         }         void spinButton_Click(object sender, EventArgs e)         {             Random rand = new Random();             int index = rand.Next(images.Count);         }     } }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

C Sharp, having an issue with the spin button and displaying the images. See Pics 

 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Net.Http.Headers;
using System.Web;  

namespace Slot_Machine
{
       public partial class Form1 : Form
    {
        //Create a Random object 
        Random rand = new Random();
        //Create an image[] = the URL to the images. 
        private Image[] images = new Image[]
        { Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Apple.bmp"),
          Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Banana.bmp"),
          Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Grapes.bmp"),
          Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Cherries.bmp"),
          Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Lemon.bmp"),
          Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Lime.bmp"),
          Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Orange.bmp"),
          Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Pear.bmp"),
          Image.FromFile("C:\\Users\\shari\\OneDrive\\Desktop\\Friut\\Strawbwerries.bmp")
        };

public Form1()
        {
            InitializeComponent();
        }

        //Create a random method 
        void RandomPicutes()

        {
            pictureBox1.Image = images[rand.Next(0, images.Length)];
            pictureBox2.Image = images[rand.Next(0, images.Length)];
            pictureBox3.Image = images[rand.Next(0, images.Length)];
        }
        int FriutMactches()
        {
            int matches = 1;
            if (pictureBox1.Image == pictureBox2.Image) ++matches;
            if (pictureBox2.Image == pictureBox3.Image) ++matches;

            return matches;
        }

        void spinButton_Click(object sender, EventArgs e)
        {
            Random rand = new Random();
            int index = rand.Next(images.Count);
        }

    }
}

**Fruit Slot Machine Interface**

Welcome to the Fruit Slot Machine simulation!

**Interface Overview:**

- **Title:** "Let's Play!" - This inviting message is located at the top of the interface.
- **Amount Insertion Field:** Below the title, there is a label "Amount Inserted $" with an adjacent text box where users can input the amount of money they wish to wager.
- **Display Box:** Underneath the amount field, a large rectangular display shows the results of the spin.
- **Control Buttons:**
  - **SPIN:** This button initiates the slot machine spin with the inserted amount.
  - **EXIT:** This button closes the application.

Engage with the simulation by entering an amount and clicking "SPIN" to test your luck with the Fruit Slot Machine.
Transcribed Image Text:**Fruit Slot Machine Interface** Welcome to the Fruit Slot Machine simulation! **Interface Overview:** - **Title:** "Let's Play!" - This inviting message is located at the top of the interface. - **Amount Insertion Field:** Below the title, there is a label "Amount Inserted $" with an adjacent text box where users can input the amount of money they wish to wager. - **Display Box:** Underneath the amount field, a large rectangular display shows the results of the spin. - **Control Buttons:** - **SPIN:** This button initiates the slot machine spin with the inserted amount. - **EXIT:** This button closes the application. Engage with the simulation by entering an amount and clicking "SPIN" to test your luck with the Fruit Slot Machine.
### Educational Website Transcription: Fruit Slot Machine Interface

---

**Interface Title: Fruit Slot Machine**

**Description:**
This is a visual representation of a simple fruit-themed slot machine game interface. It has the following features:

1. **Title:** "Let's Play!" is prominently displayed at the top, inviting users to engage with the game.

2. **Slot Display:**
   - **Icons:**
     - A slice of watermelon.
     - Orange slices.
     - A strawberry.
   - These fruit icons represent possible outcomes in the slot machine game and are aligned in a row across the interface.

3. **Amount Inserted Section:**
   - An input field labeled "Amount Inserted $" where players can enter the amount of money they wish to wager.

4. **Buttons:**
   - **SPIN:** Activates the slot machine to randomly select fruit icons. Clicking this button simulates pulling the lever on a traditional slot machine, starting the game.
   - **EXIT:** Closes the application or exits the game interface.

**Layout Explanation:**
The interface has a straightforward, user-friendly design that mimics traditional slot machines. The use of bright, engaging fruit images enhances the visual appeal and emphasizes the game’s theme. The input and button sections are clearly labeled for ease of use, ensuring users understand how to interact with the game.

This type of educational resource can be used to teach basic programming concepts, like event-driven programming, user interface design, and simple randomization algorithms.
Transcribed Image Text:### Educational Website Transcription: Fruit Slot Machine Interface --- **Interface Title: Fruit Slot Machine** **Description:** This is a visual representation of a simple fruit-themed slot machine game interface. It has the following features: 1. **Title:** "Let's Play!" is prominently displayed at the top, inviting users to engage with the game. 2. **Slot Display:** - **Icons:** - A slice of watermelon. - Orange slices. - A strawberry. - These fruit icons represent possible outcomes in the slot machine game and are aligned in a row across the interface. 3. **Amount Inserted Section:** - An input field labeled "Amount Inserted $" where players can enter the amount of money they wish to wager. 4. **Buttons:** - **SPIN:** Activates the slot machine to randomly select fruit icons. Clicking this button simulates pulling the lever on a traditional slot machine, starting the game. - **EXIT:** Closes the application or exits the game interface. **Layout Explanation:** The interface has a straightforward, user-friendly design that mimics traditional slot machines. The use of bright, engaging fruit images enhances the visual appeal and emphasizes the game’s theme. The input and button sections are clearly labeled for ease of use, ensuring users understand how to interact with the game. This type of educational resource can be used to teach basic programming concepts, like event-driven programming, user interface design, and simple randomization algorithms.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Terminal Threads
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education