Question: 46 Chapter 3 Input and output Exercise 3.1 When you use printf, the Java compiler does not check your format string. See what happens
46 Chapter 3 Input and output Exercise 3.1 When you use printf, the Java compiler does not check your format string. See what happens if you try to display a value with type int using %f. And what happens if you display a double using %d? What if you use two format specifiers, but then only provide one value? Exercise 3.2 Write a program that converts a temperature from Celsius to Fahrenheit. It should (1) prompt the user for input, (2) read a double value from the keyboard, (3) calculate the result, and (4) format the output to one decimal place. For example, it should display "24.0 C = 75.2 F". Here is the formula. Be careful not to use integer division! 9 F=Cx+32 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
