Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. package javaapplication4;
  2.  
  3. /**
  4. *
  5. * @author Studente
  6. */
  7.  
  8. import java.io.*;
  9. public class Progetto1 {
  10. public static void main(String[] args) {
  11. // Impostazione dello standard Input
  12. InputStreamReader input = new InputStreamReader (System.in);
  13. BufferedReader tastiera = new BufferedReader (input);
  14. int eta1, eta2, eta3;
  15. double media;
  16.  
  17. System.out.println ("Inserisci le età della prima persona: ");
  18. try
  19. {
  20. String numLetto = tastiera.readLine();
  21. eta1 = Interger.valueOf (numLetto).intValue();
  22. }
  23. catch (Exception e) {
  24. System.out.println ("Numero non corretto!");
  25. }
  26.  
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement