Advertisement
Guest User

UƉ

a guest
Feb 19th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Radioatividade{
  3. public static void main(String[] args) {
  4. Scanner t = new Scanner(System.in);
  5. System.out.print("\nDIGITE A RADIOATIVIDADE ATUAL: ");
  6. double radioatividadeAtual = t.nextDouble();
  7. t.close();
  8. int tempo = 0;
  9. while (radioatividadeAtual > 0.2) {
  10. tempo = tempo(radioatividadeAtual, tempo);
  11. radioatividadeAtual = radioatividade(radioatividadeAtual);
  12. }
  13. tempo *= 50;
  14. int minutos = tempo/60;
  15. int segundos = tempo%60;
  16. System.out.printf("\n\nSAO NECESSARIOS %dMIN %dSEG\n%d SEGUNDOS ", minutos, segundos, tempo);
  17. }
  18. public static int tempo(double radioatividadeAtual, int tempo){
  19. if (radioatividadeAtual > 0.2) {
  20. return tempo + 1;
  21. }
  22. return tempo;
  23. }
  24. public static double radioatividade(double radioatividadeAtual){
  25. return radioatividadeAtual/2;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement