C/C++ Programming in a UNIX Environment, CS 3377, Assignment 08 1. [100] Create a PERL script for a number guessing game. Here are the requirements: a. Your program generates a random number between...

1 answer below »
The assignment has to be done in PEARL language. Follow exact instructions in file being attached. The program has to run in a linux environment. Show a screenshot of the commands required to run the program and the correct output.


C/C++ Programming in a UNIX Environment, CS 3377, Assignment 08 1. [100] Create a PERL script for a number guessing game. Here are the requirements: a. Your program generates a random number between 100 and 200 and keeps asking the user to guess the number until the user guesses it correctly. b. If the user guesses a number that is lower or higher than the number to be guessed then indicate that information to the user as a ‘low guess’ or a ‘high guess’ so that the user can get to the correct guess quicker. c. The program keeps track on number of guesses taken by the user to get to the correct guess. This is user’s score. d. Use a parameter for number of allowed guesses (set it some value, say 7) and your program congratulates users if user guesses the number correctly in number of guesses less than the number of allowed guesses. The program doesn’t allow user to continue beyond the number of allowed guesses and tells user that the number wasn’t guessed correctly in allowed attempts. You can print the number of allowed guesses at the beginning of the game. e. Write out user name and number of guesses taken to a game report file. Each attempt at the game will add a new line to the report file. You will submit the following: the shell script that you develop and a short description of your experiential learning while working on this project. The second part should be about 5-10 sentences (less than 150 words) talking about what you learned and the process you used to create the game. Script = 75 Points, Report = 25 Points
Answered 7 days AfterApr 20, 2021

Answer To: C/C++ Programming in a UNIX Environment, CS 3377, Assignment 08 1. [100] Create a PERL script for a...

Anurag answered on Apr 23 2021
155 Votes
document.docx
Q) a short description of your experiential learning while working on this project.
1) I have learn
t to generate random number between 2 number.
2) The function (rand k) finds a random number between 0 and k.
3) The function rand(final-initial) +initial give us the random number between two number.
4) Here we are running while loop until the number of guess by the user is equal to the correct generated number or the number to attempts is less than the maximum number of chances i.e., in our case 7 is the max number of chances.
5) We can also use for loop this in program as we have fixed the number of guessing to the users
6) As learnt to create a file with append the player’s information who played.
Q) The second part should be about 5-10 sentences (less than 150 words) talking about what you learned and the process you used to create the game.
Functions to be used:
1. rand n: To generate a random number between 0 to n and this function always returns the floating-point number. So, its result is converted to integer value explicitly.
2. Chomp (): This function is used to remove the newline character from the...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here