Question: 2. Write a Java Program to generate the random number using Bluej for the following questions. (4 marks) a. b. C. d. e. Page
2. Write a Java Program to generate the random number using Bluej for the following questions. (4 marks) a. b. C. d. e. Page Create a new class called Random Tester. Create a constructor for the Random class and assign to the field. Create 2 methods. a) printOneRandom(Prints out one Random number) b) printMultiRandom(int howMany) -(Prints out appropriate Random numbers) for this you need a loop Create a method throwDice that returns random number between 1 and 6(inclusive-0 to size-1)---- accessor method Create a method name getResponse that randomly returns one of the strings "TRUE", "FALSE", "SOMETIMES" Gr.223/ Assignment-11 3. Write a Java program in BlueJ1 environment using the following hints and show output screen. (4 marks) a) Draw the class diagram for superclass and subclass b) Write a program using the following hints in Superclass. Declare the field years with its suitable data types and assign that field to the age. Create an accessor method to return the years. c) Write a program using the following hints in Subclass. Declare the field name with its suitable data types. Use the super keyword to invoke the parameterized constructor of the super class. d) Show the example to override the method.
Step by Step Solution
There are 3 Steps involved in it
ANSWER Question 2 import javautilRandom importing Random class for generating r... View full answer
Get step-by-step solutions from verified subject matter experts
