Problem

Correct the style of the following class definition./*Environment.java This class models t...

Correct the style of the following class definition.

/*Environment.java This class models the world's environment.It was written by Dean&Dean and it compiles so it must be OK*/public class Environment{//instance variablesprivate double sustainableProduction;private doubleinitialResources;private double currentResources;privatedouble yieldFactor = 2.0;public void setSustainableProduction(double production){this.sustainableProduction = production;}// Set pre-industrial mineral and fossil resourcespublic void setInitialResources(double resources){this.initialResources=resources;}// Initialize remaining mineral and fossil resourcespublic void setCurrentResources(double resources){this.currentResources = resources;}// Fetch remaining mineral and fossil resourcespublic double getCurrentResources(){return this.currentResources;}/*Compute annual combination of renewableand non-renewable environmental production*/public doubleproduce(double populationFraction,double extractionExpense){double extraction;extraction=this.yieldFactor*extractionExpense*(this.currentResources/this.initialResources);this.currentResources-= extraction;returnextraction+populationFraction*this.sustainableProduction;}}

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 8
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT