subject

Write in Java please Description
There is a cricket that lives by our timeshare in Myrtle Beach, South Carolina. Most every night I hear it patiently chirping away. Some nights it chirps faster than others, and it seems like the warmer it is, the faster it chirps. There are many crickets, and each of them seems to behave the same. On several different nights, armed with a stopwatch and a thermometer, I recorded the frequency of the chirps and compared it to that night's air temperature.
Experimental Results
The chirping follows a simple linear formula: take the number of chirps, add 40 and divide that sum by four to get the temperature in degrees Fahrenheit.
Assignment
Create a simulation to model the crickets chirping at various randomly generated frequencies, create an Environmentclass that knows and can return the current temperature. Create a Cricket class that chirps, or for simplicity, returns how many chirps per minute the cricket would make at that temperature. Repeat the simulation for at least three trials.
Extension: There is a cricket variety in some parts of South Carolina that is a little slower than most normal Carolina crickets. Add a ClemsonCricket class that extends Cricket but chirps slower by 20%.
Bonus: Implement polymorphism in the driver class.
Rubrics
Cricket class should include the following items:
A variable that stores the frequency of chirps.
A default constructor that initializes the frequency to a random value
An overloaded constructor that initializes the frequency to a value of your choice that gets passed on as a parameter.
A method for changing the frequency to a random value.
A getter method that returns the frequency.
clemsonCricket class should include the following items:
A default constructor that initializes the frequency to a random value that is 20% lower than what the parent class constructor would initialize it to.
A overloaded constructor that calls to the parent constructor.
A polymorphic method that changes the frequency value to a value that is 20% lower than what the parent method would change it to.
Environment class should include the following items:
A variable that stores the temperature.
A default constructor that initializes the temperature to a value of your choosing.
An overloaded constructor that initializes the temperature based on the formula in the assignment.
A method that takes in a frequency as a parameter and calculates the temperature based on the formula in the assignment.
testCrickets program should do the following items:
Creates an Environment object in the test program or in the Cricket or clemsonCricket classes and displays temperature Creates a cricket object and displays temperature before and after changing frequency
Creates a Clemson cricket object and displays temperature before and after changing frequency
Creates a polymorphic Clemson cricket object and displays temperature before and after changing frequency.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:30, Angellbatton6763
At an open or uncontrolled intersection, yield if a. your road is paved and the crossroad is not b. the cross road is paved and yours is not c. you have two or more passengers in your vehicle d. you did not yield in the last intersection
Answers: 1
image
Computers and Technology, 22.06.2019 20:00, jayjay5246
What is the term for water wave that is created by an underwater earthquake
Answers: 1
image
Computers and Technology, 24.06.2019 02:30, Esmail
Write the pseudo code for this problem based on what you learned from the video. the purpose is to design a modular program that asks the user to enter a distance in kilometers, and then converts that distance to miles. the conversion formula is as follows: miles = kilometers x 0.6214
Answers: 3
image
Computers and Technology, 24.06.2019 04:30, minecrafter3882
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
You know the right answer?
Write in Java please Description
There is a cricket that lives by our timeshare in Myrtle Bea...

Questions in other subjects:

Konu
Mathematics, 19.03.2021 18:00
Konu
English, 19.03.2021 18:00
Konu
Mathematics, 19.03.2021 18:00