Question: CMPS 2 9 0 0 - Fall 2 0 2 4 Programming Assignment # 1 For this assignment we will be just doing a simple

CMPS 2900- Fall 2024
Programming Assignment #1
For this assignment we will be just doing a simple guess the number game. During the
exercise well assume we have two players that wont be seeing each others input (although
realistically we will always see it all). We will start by allowing Player 1 to enter a whole number
for the other player to try and guess. Player 2 will then attempt to guess the number, and your
program will give feedback on whether their guess is too high, too low, or correct.
Requirements:
Place comments in your program. Include your name, date, and a short description of
the program at the top of it.
Continue to comment your code as necessary. Remember we want to be able to
come back to this later and remember what we did!
Assume the users know what to input as we dont have the ability to print strings yet.
You can still make simple prints using individual characters for now.
See my sample for some simple ideas.
Do not worry about attempting to print full strings at the moment.
Let the game continue until player 2 has the correct value.
Youll need to make sets of statements equivalent to high level structures such as
conditional statements and loops.
Dont worry about creating actual strings yet, use short sets of characters to get your
information across. A simple + or - is sufficient for example.
Hints:
The ASCII Table will help a lot with formatting and printing. Remember we can use the
decimal value, the escaped character version, or a properly formatted hex version to
represent the number.
The first lab can be a good resource for going back to how to print properly.
Remember to keep it simple, you dont need anything more than what we have gone
through so far.
Your output does not need to match mine exactly, you could make it two vertical columns
for instance instead of two rows, but the formatting must remain readable and
understandable.
Sample Outputs: (Note: user input is bold and underlined for readability. This is not
something your program needs to do.)
Run #1:
P1: 50
P2:
50
Yes!
-- program is finished running
Run #2:
P1: 64
P2:
32
Low
80
High
50
Low
75
High
65
High
60
Low
63
Low
64
Yes!
-- program is finished running For this assignment we will be just doing a simple guess the number game. During the
exercise we'll assume we have two players that won't be seeing each other's input (although
realistically we will always see it all). We will start by allowing Player 1 to enter a whole number
for the other player to try and guess. Player 2 will then attempt to guess the number, and your
program will give feedback on whether their guess is too high, too low, or correct.
Requirements:
Place comments in your program. Include your name, date, and a short description of
the program at the top of it.
Continue to comment your code as necessary. Remember we want to be able to
come back to this later and remember what we did!
Assume the users know what to input as we don't have the ability to print strings yet.
You can still make simple prints using individual characters for now.
See my sample for some simple ideas.
Do not worry about attempting to print full strings at the moment.
Let the game continue until player 2 has the correct value.
You'll need to make sets of statements equivalent to high level structures such as
conditional statements and loops.
Don't worry about creating actual strings yet, use short sets of characters to get your
information across. A simple + or - is sufficient for example.
CMPS 2 9 0 0 - Fall 2 0 2 4 Programming

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!