SHARE
TWEET

Untitled

a guest Jan 11th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class question5
  4. {
  5.     public static void main(String[] args)
  6.     {
  7.         //Creates Scanner object
  8.         Scanner keyb = new Scanner(System.in);
  9.        
  10.         //Prompts user for input
  11.         System.out.print("Enter initial amount of Technetium-99: ");
  12.         //Variables are assigned
  13.         double originalAmount = keyb.nextDouble();
  14.         double time = 0;
  15.         double amount = 0;
  16.        
  17.         //Since time == 0, this loop SHOULD work.
  18.         while(time <= 24);
  19.         {
  20.             //The amount should be calculated
  21.             amount = originalAmount * (Math.pow(Math.E, (((-1)*time)*((Math.log(2))/6)))); 
  22.             //Answer printed out
  23.             System.out.print("Amount remaining at time " + time + ": " + amount);
  24.             //time variable updated
  25.             time = time + 3;
  26.         }  
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top