Proposition
Write a Java application that takes an integral Celsius temperature as input and converts it to its Kelvin equivalent. The formula is
Write a Java application that takes an integral Celsius temperature as input and converts it to its Kelvin equivalent. The formula is
Kelvin = Celsius+273
After the Celsius temperature is input,it should be displayed along with the corresponding Kelvin equivalent. The application should include appropriate messages identifying each value. Be sure to include appropriate comments in your code, choose meaningful identifiers, and use indentation as we do in the code in this chapter.
Code
int c = 40;
int k = c+ 273;
print (k);
Output
313
Text book name : Programming and Problem solving with Java second edition
Author : Nell Dale and Chip Weems
ISBN : 978-0-7637-3402-2
ไม่มีความคิดเห็น:
แสดงความคิดเห็น