Answer In Javd Create a class called Forecast. Your Forecast class contains concepts associated with a weather forecast. Fore
these methods do not have print/output statements a method that determines whether or not it rains o this method returns a bo

Add a method to your Forecast class that calls print() and prints the result to a file. You will need to add try/catch block

Answer In Jaya Create a class called Forecast. Your Forecast class contains concepts associated with a weather forecast. Fore
these methods do not have print/output statements a method that determines whether or not it rains this method returns a bool Answer In Javd Create a class called Forecast. Your Forecast class contains concepts associated with a weather forecast. Forecast does not contain a main method. Forecast should contain the following: an attribute for the temperature a floating point number from-100.0 through 150.0 degrees Fahrenheit if no value or an invalid value is supplied, the default is 72.0 O an attribute for the sky condition a string if no value is supplied, the default is “clear” O an attribute for the chance of rain an integer from 0-100 that represents a percentage if no value or an invalid value is supplied, the default is 0% at least two constructors accessors and mutators for all variables methods that convert the temperature: o from Fahrenheit to Celsius from Celsius to Fahrenheit C from Fahrenheit to Kelvin o from Kelvin to Fahrenheit these methods return the converted temperature these methods do not have print/output statements a method that determines whether or not it rains o this method returns a boolean this method does not have a print/output statement a print() method that prints useful information about the forecast Write a separate class (with a main method) that tests each of the methods in your Forecast class Add a method to your Forecast class that calls print() and prints the result to a file. You will need to add try/catch block around your file 1/O code; your try/catch block will include exception handling. At a minimum, catch errors dealing with (1) FileNotFoundException, (2) IOException, and (3) all other exceptions. It’s fine if you are handling these errors simply by printing some information about the error a that is caught. Include in your main method a method call to your new file output method. Answer In Jaya Create a class called Forecast. Your Forecast class contains concepts associated with a weather forecast. Forecast does not contain a main method. Forecast should contain the following: an attribute for the temperature a floating point number from-100.0 through 150.0 degrees Fahrenheit if no value or an invalid value is supplied, the default is 72.0 O an attribute for the sky condition a string if no value is supplied, the default is “clear” an attribute for the chance of rain an integer from 0-100 that represents a percentage if no value or an invalid value is supplied, the default is 0 % C at least two constructors accessors and mutators for all variables methods that convert the temperature: from Fahrenheit to Celsius from Celsius to Fahrenheit from Fahrenheit to Kelvin from Kelvin to Fahrenheit these methods return the converted temperature i Edit More these methods do not have print/output statements a method that determines whether or not it rains this method returns a boolean this method does not have a print/output statement print) method that prints useful information about the forecast a Write a separate class (with a main method) that tests each of the methods in your Forecast class Part 2 (20%) Add a method to your Forecast class that calls print() and prints the result to a file. You will need to add a try/catch block around your file l/O code; your try/catch block will include exception handling. At a minimum, catch errors dealing with (1) FileNotFound Exception, (2) IOException, and (3) all other exceptions. It’s fine if you are handling these errors simply by printing some information about the error that is caught. Include in your main method a method call to your new file output method.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *