Transcribed TextTranscribed Text

Program: Hangman In this game, the computer generates a number between 1-100 and the user should guess that number is 6 tries or less. For each time the user gets a wrong guess the computer should tell the user if the number generated by the computer is greater or less than the user number. The user has a total of 6 tries. For each time the user fail, a picture will be displayed in a PictureBox showing part of a gallows platform. If the user uses all six tries, then a picture of a skeleton hanging will be shown. If the user gets the number in 6 tries or less, a picture of a dancing skeleton will be displayed. Your GUI should have one textbox input. One button. A label for displaying the result, a picture box for displaying an image each time the user checks his number, and a group box containing two radio buttons that are displayed once the game is over to prompt the user if he/ she want to play again. The groupBox should not be apparent when the game is in play mode. The focus will be always on the textbox that takes the input and the enter key should be a default action that simulate the button when pressed. Your programming should utilize if-stmts and also a switch structure. The switch structure will check which try the user is in, and take appropriate action like loading the correct picture in the picture box. You will be provided with all pictures for this program. You need to import these pictures as resources in order to use them. Screenshots are below on how the program should look.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

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;

namespace hangman
    public partial class Form1 : Form
       private int guessedNumber;
       private Random rnd;
       private int counter;
       public Form1()
            pictureBox1.Image = Properties.Resources.Hangman_Game_red;
            rnd = new Random();
            button1.Enabled = false;
            textBox1.Enabled = false;
            radioButton1.Checked = false;
            radioButton2.Checked = false;

       private void radioButton2_CheckedChanged(object sender, EventArgs e)

By purchasing this solution you'll be able to access the following files:

for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available C-Family Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats