

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Instructions and requirements for completing assignment 3 in the ece 131 - programming fundamentals course. The assignment involves writing a higher-lower guessing game program in c language, using terminal text input and output. The user tries to guess a randomly generated number within a given range, and receives feedback on whether their guess is too high or too low. The game continues until the user runs out of guesses or guesses the number correctly.
What you will learn
Typology: Lecture notes
1 / 2
This page cannot be seen from the preview
Don't miss anything!
Instructor: M. Wolverton
Complete the coding directive in your C language IDE of choice (Eclipse, NetBeans) or by command line compiling. Once you have verified that the program works as intended, login to the file server at cec-code-lab.aps.edu and create a folder with the assignment name (e.g. Code 3). Locate all .c and .h source files written by you (e.g. hlgame.h, hlgame.c, main.c) and upload them to into the assignment folder. Code will be downloaded and archived for grading on the assignment due date.
Write a program that uses terminal text input and output to create a game where the computer generates a random number and the user tries to guess it. The as the user guesses incorrectly, they should be told whether their guess is too high or too low. If the user passes a certain number of guesses they lose, and if they guess the number in fewer tries, they win. Feature Requirements
Sample Output |-----------------------------------| |Higher - Lower Number Guessing Game|
M. Wolverton 2021 |
---|
You have 7 guesses remaining. Enter a number between 1 (inclusive) and 100 (exclusive). 50 Your guess is too high. You have 6 guesses remaining. Enter a number between 1 (inclusive) and 100 (exclusive). 25 Your guess is too low. You have 5 guesses remaining. Enter a number between 1 (inclusive) and 100 (exclusive).
Invalid entry. Enter a number between 1 (inclusive) and 100 (exclusive). ... You have 1 guesses remaining Your guess is too high. Enter a number between 1 (inclusive) and 100 (exclusive). 28 |-----------------------------------|
Correct, you got it! |
---|
You have won 1 time and lost 0 times. Would you like to play again? (y/n) n Thanks for playing!