You are to design a fight game between Neo versus Smith. The program needs to be organized using at least three functions. The specifications are as follows: 1. The program should display your name and your major. 2. The program should first call a password function. a. Request a password, multiple characters followed by return. b. For every character entered, display * character.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Please answer in C format
You are to design a fight game between Neo versus Smith. The program needs to be organized
using at least three functions. The specifications are as follows:
1. The program should display your name and your major.
2. The program should first call a password function.
a. Request a password, multiple characters followed by return.
b. For every character entered, display * character.
c. The correct password is EGC251 or egc251.
d. If the correct password is entered, proceed to the game.
e. If a wrong password is entered, prompt the user with a statement indicating the
password is incorrect and prompt the user for a correct password. If the second
password is also incorrect, prompt the user that this is the last attempt. If the third
password is entered incorrectly, ignore further attempts.
3. The game consists of three rounds. At each level, a new health-level is calculated. At the
end of the third round, the one with the higher health level is announced the winner.
4. Initially, value of health-level is randomized between 20.0 and 24.99.
5. During each round, two sequential integer inputs punch_N and punch_S between 2 and 5
are accepted.
6. Following each punch, the damage (in float) to the opponent is calculated using
damage_S = punch_N * (health_level_S*randomized(0.05 - .1)
damage_N = punch_S * (health_level_N*randomized(0.05 - .1)
7. Using individual damage, a new health level is calculated using
health_S= health_S * skill– damaged_S
health_N = health_N * skill – damaged_N
Note that skill is a float variable which needs to be randomized between 0.9 and 1.1 each
time it is used.
8. If the health level of a fighter drops below 0.5, the fight is over by a knock out.
9. Otherwise, proceed to the next round.
10. After three rounds using the health_level of fighters, determine the winner.
Note: you are encouraged to make the game more challenging and interesting. Make sure you
use plenty of comments in your code to make it readable.
Transcribed Image Text:You are to design a fight game between Neo versus Smith. The program needs to be organized using at least three functions. The specifications are as follows: 1. The program should display your name and your major. 2. The program should first call a password function. a. Request a password, multiple characters followed by return. b. For every character entered, display * character. c. The correct password is EGC251 or egc251. d. If the correct password is entered, proceed to the game. e. If a wrong password is entered, prompt the user with a statement indicating the password is incorrect and prompt the user for a correct password. If the second password is also incorrect, prompt the user that this is the last attempt. If the third password is entered incorrectly, ignore further attempts. 3. The game consists of three rounds. At each level, a new health-level is calculated. At the end of the third round, the one with the higher health level is announced the winner. 4. Initially, value of health-level is randomized between 20.0 and 24.99. 5. During each round, two sequential integer inputs punch_N and punch_S between 2 and 5 are accepted. 6. Following each punch, the damage (in float) to the opponent is calculated using damage_S = punch_N * (health_level_S*randomized(0.05 - .1) damage_N = punch_S * (health_level_N*randomized(0.05 - .1) 7. Using individual damage, a new health level is calculated using health_S= health_S * skill– damaged_S health_N = health_N * skill – damaged_N Note that skill is a float variable which needs to be randomized between 0.9 and 1.1 each time it is used. 8. If the health level of a fighter drops below 0.5, the fight is over by a knock out. 9. Otherwise, proceed to the next round. 10. After three rounds using the health_level of fighters, determine the winner. Note: you are encouraged to make the game more challenging and interesting. Make sure you use plenty of comments in your code to make it readable.
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY