Given the following fragment that purports to convert from degrees Celsius to
degrees Fahrenheit, answer the following questions:
double celsius = 20;
double fahrenheit;
fahrenheit = (9 / 5) * celsius + 32.0;
a. What value is assigned to fahrenheit?
b. Explain what is actually happening, and what the programmer likely wanted.
c. Rewrite the code as the programmer intended.
Q269;
What is the output produced by the following lines of program code?
int n = (int)3.9;
System.out.println("n == " + n);
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here