Question: CSCI 237 Lab Date: 10 February 2020 Lab Activity 2-Triples Due: 16 February 2020 Please submit your lab on Moodle. Notes: Add comments to document
CSCI 237 Lab Date: 10 February 2020 Lab Activity 2-Triples Due: 16 February 2020 Please submit your lab on Moodle. Notes: Add comments to document your code. Comments are not optional and must be included. Spell things carefully, including capitalization, since Java is fussy about that Indent things carefully Check your results! Testing your code is IMPORTANT! Make sure your program compiles and runs before uploading to Moodle. Create a Java program that rolls a 20-sided die 3 times. This will produce a set known as a triple. Ask the user how many triples they would like. You will need to create a Triples class. o There should be a constructor. o There should be a method to roll the die 3 times. (Random would be good to use here.) o You should create a toString method in your Triples class to help with printing out the results. The only thing that should be in the main method is the interaction with the user and a way to call the methods you need however many times you need to o The output should show the numbers rolled for each triple. See sample output below. How many triples would you like? 20, 14, 10 11, 7, 4 16, 6, 8 19, 10, 17 16, 15, 17 Page 1 of 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
