Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class question5
- {
- public static void main(String[] args)
- {
- //Creates Scanner object
- Scanner keyb = new Scanner(System.in);
- //Prompts user for input
- System.out.print("Enter initial amount of Technetium-99: ");
- //Variables are assigned
- double originalAmount = keyb.nextDouble();
- double time = 0;
- double amount = 0;
- //Since time == 0, this loop SHOULD work.
- while(time <= 24);
- {
- //The amount should be calculated
- amount = originalAmount * (Math.pow(Math.E, (((-1)*time)*((Math.log(2))/6))));
- //Answer printed out
- System.out.print("Amount remaining at time " + time + ": " + amount);
- //time variable updated
- time = time + 3;
- }
- }
- }
Add Comment
Please, Sign In to add comment