« All Events
7 PM – Intro To Java – Gamas
May 26, 2022 @ 7:00 pm - 8:00 pm
Today We Do
- We were able to make MainActivity.java change the sourceTempLabel name from Fahrenheit to Celcius and convertedTempLabel from Celcius to Fahrenheit when user change the spinner.
Homework
- When we change the spinner selection from “Celcius to Fahrenheit” it changes the header accordingly. But when we change the spinner selection back to “Fahrenheit to Celcius” or “Fahrenheit to Kelvin”, the header is not changed. Add code inside MainActivity.setConversionType(String) method so the headers are changed accordingly.
- When user change the conversionType from the spinner and the user click the “CONVERT” button, change the formula accordingly. Currently, the formula we are using is only from Fahrenheit to Celcius.
- When user select “Celcius to Fahrenheit”, we need to use this formula F = (C × 9/5) + 32
- When user select “Fahrenheit to Kelvin”, we need to use this formula K = (F − 32) × 5/9 + 273.15