Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Design a positive random number generator using method overloading. a) Return a random number between 0 to 100 if no parameter is passed by

4. Design a positive random number generator using method overloading. a) Return a random number between 0 to 100 if no parameter is passed by the user. b) Return a random number between o to "n", if user pass 1 "n" int number. c) Return a random number between 101 to 500 and append a message if user pass the single string message. d) Return a random number between the given two numbers, if the user passes two int number. e) Return a random number between the given two numbers and append a message if user pass two int number and a string message. f) You can use your own logic to calculate random number OR use built in library function.

2. create a class of a Player. Create child classes called Footballer and Cricketer. Create child classes of Footballer and call it GoalKeeper, Midfielder and Defender. Create child classes of Cricketer and call it Bowler, Batsman and allrounder using the concept of inheritance. Define possible properties and methods of each class using appropriate access modifiers a) Show how encapsulation concept works for this. b) Write which type(s) of inheritance this solution would take. c) Create objects of each class and access members. d) Show how child classes can use parent class members.

language java provide answer as early as possible ask if you have any query

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

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

What are the Canadian Marketing Association opportunity provisions?

Answered: 1 week ago

Question

Understand how customers respond to effective service recovery.

Answered: 1 week ago