Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Know about the different kinds of consultants

Answered: 1 week ago

Question

3. Who would the members be?

Answered: 1 week ago

Question

What was the role of the team leader? How was he or she selected?

Answered: 1 week ago