Cuyahoga Community College Passing the Dice Rolling Method Lab

For this lab, start with your completed lab 13.

Now, instead of just passing the dice rolling method the number of dice to roll, also pass a second value. This second value should be the size of the dice.

  • In D&D, there are 4, 6, 8, 10, 12, 20, 30 etc… sided dice.
    • So, perhaps you will tell the method to roll 2, 6 sided dice.
    • Or perhaps you will tell the method to roll 1, 8 sided die.
    • Or maybe even you will tell the method to roll 13, 9 sided dice. (not sure if that is a thing…)

So, in this case, your roll dice method must accept two parameters.

Hint:

So far, when using random, we have gone from a set range such as:

rnd.next(1, 7);

How can you change that line (it will be the 7 that gets changed) to accommodate a value that isn’t known before the program is executed?

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.