Question: Correct the style of the following program. /*Resources.java This class evaluates resource use. It was written by Dean & Dean and it compiles. So it
Correct the style of the following program.

/*Resources.java This class evaluates resource use. It was written by Dean & Dean and it compiles. So it must be OK*/ public class Resources { // instance variables private double initial Resources; private double current Resources; // renewable and nonrenewable environmental production private double sustainable Production; // ratio of resulting production over input materials private static final double yieldfactor=2.0; // assign mineral & fossil resources public void setInitial Resources (double resources) {this. initial Resources-resources; } // assign remaining resources public void set Current Resources (double resources) {this. current Resources-resources; } public void setSustainable Production (double production){this. sustainable Production = production; } // Fetch remaining mineral and fossil resources public double getCurrent Resources () { return this.current Resources; }/* Compute annual combination of renewable and nonrenewable environmental production*/public double produce (double population Fraction, double extraction Expense) { double extraction= Resources.yieldfactor*extraction Expense* (this.current Resources/this.initial Resources); this.current Resources -= extraction; return extraction+population Fraction*this.sustainable Production; }}
Step by Step Solution
3.36 Rating (146 Votes )
There are 3 Steps involved in it
From the image you provided a Java program that needs some reformatting to align with common Java co... View full answer
Get step-by-step solutions from verified subject matter experts
