Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C# Up until this point, you have learned: How to create variables How to take input from the user How to create conditional statements

In C#

Up until this point, you have learned:

  • How to create variables
  • How to take input from the user
  • How to create conditional statements in code
  • How to create a main game loop
  • How to create functions/methods
  • and more

This assignment combines the above points in order to complete your first micro-game.

  • This game will take input from one user in the form of an integer.
  • Another user will attempt to guess that number and input that number into the program.
  • The program must report back if the guess was too high, too low, or correct.
  • After a certain number of tries without guessing correctly, the player loses the game.
  • The player then chooses to either quit, or try again.

The purpose of this assignment is to practice problem solving. The problem here has nothing to do with how to design a guessing game. The game is done. The problem is how to implement and execute the guessing game. Can you take the fundamental building blocks you have learned and put them together in your own way to create the desired result?

You will be using Visual Studio to make a Console Application.

Instructions:

  1. Make sure to complete the Setup Confirmation assignment. It will walk you through how to prepare a Visual Studio project.
  2. Rules: Create a program that explains the rules of the game.
    1. Player 1 Picks a number between 0 and 100
    2. Player 2 gets 5 guesses to find Player 1s number.
    3. After Player 2 guesses correctly or loses the game, the game will provide the option to start over.
    4. At any time, the users can opt to exit out of the game by typing quit or exit
  3. Player 1: User will input a number between 0 and 100.
    1. The program should validate that:
      1. Player 1 did input a number and not anything else
      2. If the number is less than 0, make it 0.
      3. If the number is greater than 100, make it 100.
      4. If Player 1 did not input a number, ask the player to please stick to only numbers.
    2. The program will then ask Player 2 for their guess.
  4. Player 2: User will input a number between 0 and 100
    1. The program should validate this input the exact same way using the same criteria
  5. Assessment:
    1. If the guess is correct, the game will tell the player how many guesses it took to get it right.
    2. If this is the last guess, the game will tell the player that they have run out of guesses and have lost the game.
    3. If the guess is too high or too low, the game will relay that information to the player and also provide how many guesses are left.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago