34.3k views
2 votes
3. Cobalt 60, a radioactive form of cobalt used in cancer therapy, decays or dissipates over a period of time. Each year, 12 percent of the amount present at the beginning of the year will have decayed. If a container of cobalt 60 initially contains 10 grams,

create a Java program to determine the amount remaining after five years.

1 Answer

4 votes

Answer:

Step-by-step explanation:

Here's a Java program that calculates the amount of cobalt 60 remaining after 5 years:

public class Cobalt60Decay {

public static void main(String[] args) {

double amount = 10.0; // initial amount in grams

double decayRate = 0.12; // 12% decay rate per year

for (int i = 1; i <= 5; i++) {

amount -= decayRate * amount;

}

System.out.println("After 5 years, the amount of cobalt 60 remaining is " + amount + " grams.");

}

}

This program uses a for loop to calculate the amount of cobalt 60 remaining after 5 years. It initializes the initial amount to 10 grams and the decay rate to 0.12 (12%) per year. Then, for each year, it subtracts the decayed amount from the initial amount using the formula:

amount = amount - (decayRate * amount)

After 5 years, the program prints out the amount of cobalt 60 remaining. The output should be:

After 5 years, the amount of cobalt 60 remaining is 4.6656 grams.

User Michael Hulet
by
8.6k points