Wednesday, November 4, 2015

// // Leave a Comment

Java Program To Convert Celsius To Fahrenheit

The program below is the answer to Liang's Introduction to Java Programming (9th Edition) Chapter 2 Exercise 2.1.
/**
 *
 * @Author: Aghatise Osazuwa
 * Website: www.cscprogrammingtutorials.com
 *
 * Exercise 2.1 - Convert Celsius To Fahrenheit
 *
 */ 

import java.util.Scanner;

public class ConvertCelsiusToFahrenheit {
    public static void main (String [] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("This Program Converts Degrees From Celcius To Fahrenheit.\n");
        System.out.print("Enter Celcius Degree: ");
        double celcius = input.nextDouble();
        double fahrenheit = (9.0/5) * celcius + 32;
        System.out.println (celcius + " Celcius is " + fahrenheit + " Fahrenheit.");
    }
}


Click here to see other solutions to Introduction to Java Programming.

0 comments:

Post a Comment


DISCLAIMER: Opinions expressed in comments are those of the comment writers alone and does not reflect or represent the views of the post author. We reserve the right to delete any post deemed inappropriate or offensive and/or spammy. Please do not use abusive words/hate speech.

I Appreciate your valuable Feedback. So, Please DO NOT SPAM - Spam comments will be deleted immediately.

Don't use brand name in name field and you're not allowed to use links in comments unless it's necessary. Such comments will be removed immediately.

Thanks.