Question
1. Ask the user to input a low temperature and high temperature in Celsius. Use these values to control the loop and display in table
1. Ask the user to input a low temperature and high temperature in Celsius. Use these values to control the loop and display in table format the Celsius and Fahrenheit values between the two inputs. 2. Ask the user to input a low temperature and high temperature in Fahrenheit. Use these values to control the loop and display in table format the Fahrenheit and Celsius values between the two inputs. The following is the program that they need to be added to:
public class CelToFahr{
public static void main(String[] args){ //Declare Valriables int i = 0;
System.out.println("Celsius | Fahrenheit"); System.out.println("--------+-----------");
for ( i = 0; i <= 100; i+= 10) { System.out.print(" " + i + " |");
// formula for celsius to fahrenheit conversion double sum = (i * (9.0/5.0)) + 32; System.out.printf("%5d", (int)sum ); System.out.println(); } } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started