Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program Debugging. Consider and understand the scenario that follows. Debug the program in order for it to run as stated in its specification, place appropriate
Program Debugging. Consider and understand the scenario that follows. Debug the program in order for it to run as stated in its specification, place appropriate comment/s (what the code does) for each major method (17 pts). Underline/Highlight the changes you have made using a word processing software. Include 3 screenshots of the input/output of the program using these values: 3, 8 and 12. Upload the file as well as the.java file. The program that follows, when run, will let the user 'roll a pair of dice' n-times (i.e. generate a number between 1 and 6), where n is a positive integer entered by a user. The program then outputs the pair of numbers ('rolled dice'), as well as the sum of the numbers (each pair of dice). The pairs of numbers are stored in a 2-dimensional array, and the sum of each pair are stored in a single-dimensional array. import java.util.Scanner; import java.util.Random; public class FinalExamPart2_FamilyName_GivenName{ public static void main (String() args) { Scanner input = Scanner(System.in); System.out.print("Enter the amount of times a pair of dice will roll: "); int times = keyboard.nextInt(); int[] dicePairs = rolldicePairs(times); System.out.println("The rolled pairs of numbers are:"); printDicePairs(dicePairs); System.out.println("The sum of each pairs of numbers are:"); int[][] dicePairsSums = addDicePairs(dicePairs); printDicePairsSums (dicePairsSums); } public static double[][] rollDicepairs(int times) { int[][] dice = new int[times] [2]; Random die = new Random(); for(int x=0; x
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started