Created
September 5, 2017 13:19
-
-
Save lduboeuf/6692857e09f5a3220692e5d5db87bc99 to your computer and use it in GitHub Desktop.
algo, conversion celcius, degré
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * To change this license header, choose License Headers in Project Properties. | |
| * To change this template file, choose Tools | Templates | |
| * and open the template in the editor. | |
| */ | |
| package com.ldub.testouille; | |
| import java.util.Scanner; | |
| /** | |
| * | |
| * @author lionel | |
| */ | |
| public class TestouilleDegre { | |
| /** | |
| * @param args the command line arguments | |
| */ | |
| public static void main(String[] args) { | |
| /* | |
| if (args.length<1){ | |
| System.err.println("oulala besoin d\'un argument"); | |
| System.exit(0); | |
| } | |
| */ Scanner scan = new Scanner(System.in); | |
| String continuer = "n"; | |
| do { | |
| convertir(); | |
| System.out.println("Voulez vous continuer o/n ?"); | |
| continuer = scan.nextLine(); | |
| }while(continuer.equals("o")); | |
| } | |
| public static void convertir(){ | |
| System.out.println("Saisir un degré celcius:"); | |
| Scanner scan = new Scanner(System.in); | |
| float deg = scan.nextFloat(); | |
| float f = deg * 9/5 + 32; | |
| System.out.println("f:" + f); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment