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 11:30, kieraweems2034
Communication is the exchange of information. true false
Answers: 2
image
Computers and Technology, 25.06.2019 05:10, jennynmike03
What is the output of the following program? #include using namespace std; class bclass { public: void print() const; bclass(int a = 0, int b = 0); //postcondition: x = a; y = b; private: int x; int y; }; class dclass: public bclass { public: void print() const; dclass(int a = 0, int b = 0, int c = 0); //postcondition: x = a; y = b; z = c; private: int z; }; int main() { bclass bobject(2, 3); dclass dobject(3, 5, 8); bobject. print(); cout < < endl; dobject. print(); cout < < endl; return 0 ; } void bclass: : print() const { cout < < x < < " " < < y < < endl; } bclass: : bclass(int a, int b) { x = a; y = b; } void dclass: : print() const { bclass: print(); cout < < " " < < z < < endl; } dclass: : dclass(int a, int b, int c) : bclass(a, b) { z = c; }
Answers: 3
image
Computers and Technology, 25.06.2019 09:30, jhahn001
Which of the following is a reason to include the people who will be using the new technology in conversations about technology upgrades for a business? a. the users would likely know if an upgrade would be necessary or even useful. b. the users would know more about the software than people in the it department. c. the users will be paying for the upgrades with their own money. d. the users will assume the upgrade will cause a drop in productivity.
Answers: 1
image
Computers and Technology, 25.06.2019 10:40, camidevecchis15
If you're using the paintbrush tool and want to change the color of the paint being used what should you change
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, 20.11.2020 03:40
Konu
Chemistry, 20.11.2020 03:40