Generate a random number for the user and for the monster

Assignment Help Basic Computer Science
Reference no: EM13308487

I have been trying for days to figure out how to get this working, but have yet to succeed in doing so. Can some please help me with this?

Repeatable steps start here

Let the player indicate his level, the monster level and any enhancements on his weapon or spells.

Generate a random number for the user and for the monster as an integer number between 1 and 500.

Monsters can be up to 5 levels above or below the player. For every level the monster is below the player level, add 10 from the player's roll. And for every level the monster is above the player's level, add 5 to the monster's roll.

Players can have enhanced weapons and spells. For an enhanced weapon, add 10 to the player roll. For an enhanced spell add 5 to player roll.

If after evaluation there is a tie re-evaluate with two new random numbers, but the player loses his weapon enhancement in the subsequent roll. The level differential remains in effect and the spell enhancement remains in place.

Display each encounter's result, including monster level, player level, enhancements, monster score and player's modified score.

Repeatable steps should end here.

To quit have the player enter a 0 for player level. That is, repeat the above steps until the user says that he is finished by entering a 0 for the next player number. Note you should only have to seed the random number generator once.

When the user indicates that he is finished, display the results, including the number of monsters faced, number of monsters killed and the subsequent kill ratio (number of kills/ number of encounters).

 

Reference no: EM13308487

Questions Cloud

Critical analysis of a project business case : Critical analysis of a project business case and Critical analysis of a Project Management Plan (PMP)
Explain why your technique is lossless and not lossy : Devise a way to compress the following list of last names using a lossless technique. Describe your method and show the compressed list. Explain why your technique is lossless and not lossy.
What is the red-shifted wavelength of hydrogen alpha light : The hydrogen alpha emission spectra has a 658.28 nanometer wavelength. What is the red-shifted wavelength of hydrogen alpha light from the bootes galaxy cluster
Natural law and the fiduciary duties of business managers : Joseph Johnston argues, in his article, Natural Law and the Fiduciary Duties of Business Managers that..."Simply put, stakeholder theory sounds good in social theory but will not work in practice."
Generate a random number for the user and for the monster : I have been trying for days to figure out how to get this working, but have yet to succeed in doing so. Can some please help me with this?
Define calculations and format the table : internship at Mountain View Realty, a real estate firm that focuses in the North Utah County area. The previous intern developed a spreadsheet listing houses listed and sold during the last several months. She included addresses, location, list pr..
What would be reading on barometer containing benzene : What would be the reading on a barometer containing Benzene at 20 degrees Celsius at a time when the atmospheric pressure was equivalent to 12.3 m of water
Create two arrays with 5 elements each : Create two arrays with 5 elements each: one will hold Strings and the second will hold integers.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Prepare a paper on supercomputing

Consider any of the supercomputing examples we discussed in class, and find a scientific paper describing it. you must find an article in a valid IEEE or ACM publication (journal, conference, etc.)

  Draw dfsa for identifiers contain only letters and digits

Draw a DFSA for identifiers that contain only letters and digits, where the identifier must have at least one letter, but it need not be the first character. Hint: everything to the left of the leftmost letter must be a digit.

  What is the average magnitude of the force on the ball

A force in the negative direction of an x axis is applied for 27 ms to a 0.24 kg ball initially moving at 16 m/s in the positive direction of the axis. The force varies in magnitude, and the impulse has magnitude 45.1 N s.

  Explain and identify and explore contemporary challenges

Identify and explore contemporary challenges and opportunities in information systems and to formulate an opinion or judgement and offer possible solutions.

  What is the accuracy of a two-bit predictor

What is the accuracy of a two-bit predictor, assuming the predictor starts off in the bottom left state? What if the pattern repeats forever?

  Describe the importance of variable naming and conventions

Describe the importance of variable naming and conventions. What makes this so important when working with a team to develop a game or application? What do you think are the implications of not naming, or not naming correctly, variables in the ..

  Explain how risc-pipelining evolved over past years

Explain how concepts such as RISC, pipelining, cache memory, and virtual memory have evolved over the past twenty-five years to improve system performance.

  How has the progression of communication technology

How has the progression of communication technology affected the business environment?

  Sort the array and write out the sorted array

Consider a program that will read employee information into an array of objects, sort the array by employee identification number, write out the sorted array, and compute various statistics on the data, such as the average age of an employee.

  Installation options for customer tracking system

Which installation options are available for the Customer Tracking System? Which would you recommend? How can you determine if implementation has been successful?

  Display the new list as well as the two old list

Display the new list as well as the two old list Thank you in advance.

  How components of computer system interact in system

How do components of computer system interact within system? What improvements or additions to system do you believe would benefit you or make system more user-friendly?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd