Question

In a certain building at a top-secret research lab, some yttrium-90 has leaked into the computer...

In a certain building at a top-secret research lab, some yttrium-90 has leaked into the computer analysts' coffee room. The leak would currently expose personnel to 150 millirems of radiation a day. The half-life of the substance is about three days; that is, the radiation level is only half of what it was three days ago. The analysts want to know how long it will be before the radiation is down to a safe level of 0.466 millirems a day. They would like a chart that displays the radiation level for every three days with the message Unsafe or Safe after every line. The chart should stop just before the radiation level is one-tenth of the safe level, because the more cautious analysts will require a safety factor of 10. The program should also print the first day that the room can be entered.

Problem Constants

SAFETY_FACT 10.0 /* the safety factor */
SAFE_RAD 0.466 /* the safe radiation level in millirems */

Problem Outputs

int day /* the day number*/
double radiation_level /* the radiation level in millirems*/

Additional Program Variables

double min_radiation /* the stopping level of radiation*/

Initial Algorithm

1. Compute the stopping level of radiation, that is the safe level divided by the safety factor
2. Prompt the user to enter the initial radiation level.
3. Compute and display the day number and the radiation level every three days that the radiation level exceeds the stopping radiation level. Also, indicate whether each level is safe or unsafe.
4. Display the day that the user can enter the room.
The program must have a function rad_table that takes in an initial radiation value, the minimum radiation (stopping level) and returns the day the user can enter the room.

** IN C LANGUAGE**

0 0
Add a comment Improve this question Transcribed image text
Answer #1

// do comment if any problem arises

//code

#include <stdio.h>

#define SAFETY_FACT 10.0

#define SAFE_RAD 0.466

// this function returns the day user can enter safely

int rad_table(double radiation_level, double min_radiation)

{

    int day = 0;

    while (radiation_level > min_radiation)

    {

        if (radiation_level <= SAFE_RAD)

        {

            return day;

        }

        day += 3;

        radiation_level /= 2;

    }

    return day;

}

int main()

{

    int day;

    double initial_radiation;

    double radiation_level;

    double min_radiation = SAFE_RAD / SAFETY_FACT;

    printf("Enter initial radiation level: ");

    // read initial radiation

    scanf("%lf", &radiation_level);

    initial_radiation = radiation_level;

    day = 0;

    // loop till radiation is reached minimum level

    while (radiation_level > min_radiation)

    {

        printf("\nRadiation level at day %d: %lf\n", day, radiation_level);

        printf("The radiation level is ");

        // check if radiation level is safe

        if (radiation_level <= SAFE_RAD)

            printf("safe\n");

        else

            printf("unsafe\n");

        // increement 3 days

        day += 3;

        // half life

        radiation_level /= 2;

    }

    printf("\nYou can enter the room at day %d\n", rad_table(initial_radiation, min_radiation));

}

Output:

Add a comment
Know the answer?
Add Answer to:
In a certain building at a top-secret research lab, some yttrium-90 has leaked into the computer...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I have this case study to solve. i want to ask which type of case study...

    I have this case study to solve. i want to ask which type of case study in this like problem, evaluation or decision? if its decision then what are the criterias and all? Stardust Petroleum Sendirian Berhad: how to inculcate the pro-active safety culture? Farzana Quoquab, Nomahaza Mahadi, Taram Satiraksa Wan Abdullah and Jihad Mohammad Coming together is a beginning; keeping together is progress; working together is success. - Henry Ford The beginning Stardust was established in 2013 as a...

  • In your judgement, and given only the facts described in this case, should the management of...

    In your judgement, and given only the facts described in this case, should the management of Massey energy Company be held morally responsible for the deaths of the 29 miners? Explain in detail. Suppose that nothing more is learned about the explosion other than what is described in this case. Do you think Don Blankership should be held morally responsible for the deaths of the 29 miners? Explain in detail. Given only the facts described in this case, should the...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

  • QUESTION 10 Consider the monthly data, including the estimates for March 2020, and the information in...

    QUESTION 10 Consider the monthly data, including the estimates for March 2020, and the information in the articles. Which of the following is the best analysis of and prediction for the money market in the U.S. economy for the next few months?   a. Shortages are causing panic buying by households, which has increased money demand. Lenders are increasing their lending to keep up with the needs of households and businesses. Money demand is increasing more than money supply. b. Shortages...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT