2. Write a Java Program to generate the random number using Bluej for the following questions....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
ANSWER Question 2 import javautilRandom importing Random class for generating r... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
You are asked to develop a Floppy Disk program that allows users to access a floppy disk locally mounted on a computer. You are expected to use C programming language. In your program, all file I/O...
-
The city of Toledo has received a proposal to build a new multipurpose outdoor sports stadium. The expected life of the stadium is 20 years. It will be financed by a 20- year bond paying 8 percent...
-
Perform the row operation and write the equivalent system. 1. Add Equation 1 to Equation 2. What did this operation accomplish? 2. Add 2 times Equation 1 to Equation 3. What did this operation...
-
Evaluate the integral, if it exists. S | x 1 | dx
-
Suppose that instead of choosing Earth and the ball as our system in the discussion leading up to Eq. 7.21, we had chosen to consider just the ball. Does it make sense to speak about the...
-
Waterworld Company leased equipment from Costner Company. The lease term is 4 years and requires equal rental payments of $43,019 at the beginning of each year. The equipment has a fair value at the...
-
16. Let a1, a2, 17. a <0 is: (a) 22 be in H.P. with a = 5 and a20 = 25. The least positive integer n for which " (b) 23 Sum of the series rlog. r=1 (c) 24 (d) 25 r+1 + is: r
-
What is the role of a medical guardian? Why did the court appoint a medical guardian for the child?
-
1. why is 12 a big age for development for children.? 2.why is 22 a big age for development for an adult.? 3. Government spending does not cause economic growth but it does cause economic disruption...
-
With regard to taxation of partnerships, Multiple Choice a partnership files a federal and state partnership tax return and pays taxes on its income. a partnership files a state partnership tax...
-
Prof. Hoffman in an article on "The Economics Sleep" in the June 1977 edition of the Journal of Political Economy specified a utility function for married couples recognizing the existence of females...
-
Review the narrated slide presentation "Jones Act, Cabotage, Shipbuilding, etc." and the two articles pro and con for keeping the Jones Act. In your own words describe the concept of Cabotage and how...
-
Fill in the table using this function rule. (x)=x-7 Simplify your answers as much as possible. Click "Not a real number" if applicable. f(x) 9 16 X Not a real number 5
-
1) Draw the enantiomer and a diastereomer of the following Fischer projection in the boxes below Your answers should be in wedge/dash notation. (2 points) Original molecule Enantiomer Diastereomer OH...
-
You have just begun your summer internship at Omni Instruments. The company supplies sterilized surgical instruments for physicians. To expand sales, Omni is considering paying a commission to its...
-
Kent Pham, CPA, is a 45-year-old single taxpayer living at 169 Trendie Street, La Jolla, CA 92037. His Social Security number is 865-68-9635. In 2012, Kent's W-2 as the controller of a local...
-
Frank, age 35, and Joyce, age 34, are married and file a joint income tax return for 2012. Their salaries for the year total $83,000 and they have taxable interest income of $4,000. They have no...
-
Frank Willingham has the following transactions during the year: Sale of office equipment on March 15 that cost $20,000 when purchased on July 1, 2010. Frank has claimed $5,000 in depreciation and...
-
If you stood atop a super-tall ladder three times as far from Earths center as at Earths surface, how would your weight compare with it present value?
-
How was Pioneer 10 able to escape the solar system with an initial speed less than escape speed?
-
State Newtons law of gravitation in words. Then state the law in one equation.
Study smarter with the SolutionInn App