Question

We have a steam heating boiler whose bursting pressure is known, but we of course want...

We have a steam heating boiler whose bursting pressure is known, but we of course want to use it only at pressures well below this limit. Our engineers recommend a safety factor of 2; that is, we should never exceed a pressure that is half of the rated bursting pressure. Write a java program that reads in the rated bursting pressure and the current pressure, and determines if the boiler is operating at a safe pressure.

Write a java program that reads in the rated bursting pressure and the current pressure, and determines if the boiler is operating at a safe pressure. For example: Enter the rated bursting pressure of the boiler (psi): 621 Enter the current pressure (psi): 137.8 The maximum safe pressure is 310.5 psi. The current pressure is safe. or Enter the rated bursting pressure of the boiler (psi): 625 Enter the current pressure (psi): 450 The maximum safe pressure is 310.5 psi. WARNING! The current pressure is not safe. Hint: Use three variables: burst_psi current_psi, and max_safe_psi

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

Answer:

Here is the java code:

import java.util.Scanner;

public class Main
{
   public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
       System.out.print("Enter the rated bursting pressure of the boiler (psi): ");
       double burst_psi = sc.nextDouble();
       System.out.print("Enter the current pressure (psi): ");
       double current_psi = sc.nextDouble();
      
       double max_safe_psi = burst_psi/2;
       System.out.println("The maximum safe pressure is "+max_safe_psi+" psi.");
       if(current_psi>max_safe_psi)
       {
       System.out.println("WARNING! The current pressure is not safe.");
       }
       else
       {
       System.out.println("The current pressure is safe.");
       }
      
   }
}

Output:

PLEASE UPVOTE IF YOU FOUND THIS HELPFUL!

Add a comment
Know the answer?
Add Answer to:
We have a steam heating boiler whose bursting pressure is known, but we of course want...
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
  • Write a java program that reads in the rated bursting pressure and the current pressure, and...

    Write a java program that reads in the rated bursting pressure and the current pressure, and determines if the boiler is operating at a safe pressure. For example: Enter the rated bursting pressure of the boiler (psi): 625 Enter the current pressure (psi): 137.8 The maximum safe pressure is 208.3 psi. The current pressure is safe. or Enter the rated bursting pressure of the boiler (psi): 625 Enter the current pressure (psi): 250 The maximum safe pressure is 208.3 psi....

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
ADVERTISEMENT