Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 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 base10_base2;
- import java.util.Scanner; // importiamo la classe Scanner dal relativo pacchetto
- import javax.swing.JOptionPane; // importimamo la classe JOptionPane dal relativo pacchetto
- /**
- *
- * @author Fabio
- */
- public class Base10_Base2 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- System.out.println("Ciao questo programma converte da base 10 a base 2");// stampa uuna frase in consolle
- JOptionPane.showMessageDialog(null, "Ciao genio!"); // appare il messaggio in una finestra
- JOptionPane.showConfirmDialog(null, "Vuoi continuare?"); // fiestra di dialogo con scelta
- String numero = JOptionPane.showInputDialog("Inserisci un numero!"); //finestra con input
- int numInt = Integer.parseInt(numero); //converte la stringa numero in valore
- Scanner tastiera = new Scanner(System.in); // crea uno scanner
- System.out.println("Inserisci un numero dentro la consolle!"); // stampa uuna frase in consolle
- double num = tastiera.nextDouble(); //crea la variabile num assegnata da tastiera dall'utente
- //System.out.print(numero);
- //System.out.print(numInt);
- //System.out.print(num);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement