Question: Given the following Earth class and skeleton for an EarthDriver class, provide a futureTemperature method that receives two parameters, years and annualGreenhouseGases. The years parameter

Given the following Earth class and skeleton for an EarthDriver class, provide a futureTemperature method that receives two parameters, years and annualGreenhouseGases. The years parameter holds the number of years into the future that the user is interested in. The annualGreenhouseGases parameter holds the annual emission of human- produced greenhouse gases in billions of tons. The method returns the predicted temperature for the given number of years into the future. In your method, use this (completely fabricated and unscientific) formula to calculate the earth’s temperature one year into the future: 

next year's temperature = current temperature + 2am (annual greenhouse gases-50) x .01 import

int futureYear; int years InFuture; double greenhouseGas; // year that user wants to predict temperature //

next year's temperature = current temperature + 2am (annual greenhouse gases-50) x .01 import java.util.Scanner: import java.time. LocalDate: public class EarthDriver ( public static void main(String[] args) C Scanner stdIn - new Scanner (System.in); double predicted Temperature: Earth earth:

Step by Step Solution

3.45 Rating (168 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The provided Java code comprises a main class named EarthDriver and a class named Earth The Earth cl... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction To Programming With Java A Problem Solving Approach Questions!