Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
ANSWER Question 2 import javautilRandom importing Random class for generating r...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