[SOLVED] CS212 Lab 3-Java variables, operators, conditional and iteration statements

25.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Lab3-bkji8d.zip (36.4 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (1 vote)

To become familiar with Java variables, operators, conditional and iteration statements.

  1. Open an editor of your choice and type in the following Java program shell:

public class Lab3 {

public static void main(String[] args) {

}

}

  1. Declare two local variables inside the main method of type float called fahrenheit and another called centigrade. Compile the program (making sure, of course, that it compiled with no errors.)
  2. Write a statement to assign farenheit a value of 98.6
  3. The formula to convert Fahrenheit to Centigrade is c = 5/9 (f-32)

Code this statement in your program.

Provide output statements that display to the console what Fahrenheit and converted centigrade degrees are.

  1. Now put in a for loop that will print the centigrade values of the numbers 0, 5.0, 10.0, 15.0, …, 40.0
  2. After the for loop, put in a while loop that does the same output as part 5. Show your work to your lab teacher.
  • Lab3-bkji8d.zip