Spread the word.

Share the link on social media.

Share
  • Facebook
Have an account? Sign In Now

Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

SIKSHAPATH

SIKSHAPATH Logo SIKSHAPATH Logo

SIKSHAPATH Navigation

  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
Home/ Questions/Q 27449
In Process

SIKSHAPATH Latest Questions

Pavanagg
  • 0
  • 0
Pavanagg
Asked: July 8, 20242024-07-08T03:08:08+05:30 2024-07-08T03:08:08+05:30In: Java

Write a program in NetBeans IDE 8.2 for NASA to determine if the weather conditions are favorable for the launch of a new rocket

  • 0
  • 0

Write a program in NetBeans IDE 8.2 for NASA to determine if the weather conditions are favorable for the launch of a new rocket. The program should:

  1. Ask the user for the sustained wind speed.
  2. Ask the user for the current daily temperature.
  3. If the wind speed is above 30 mph or the daily temperature is below 41°F, output that the launch must be aborted.
  4. Otherwise, output that the rocket is go for launch.

Save the program as RocketLaunch.java.

Example Runs:

Scenario 1:

Enter sustained wind speed (mph): 15
Enter current daily temperature (°F): 75
Weather conditions are good. The rocket is go for launch.

Scenario 2:

Enter sustained wind speed (mph): 45
Enter current daily temperature (°F): 70
Weather conditions are poor. Abort rocket launch!

Scenario 3:

Enter sustained wind speed (mph): 15
Enter current daily temperature (°F): 35
Weather conditions are poor. Abort rocket launch!

Scenario 4:

Enter sustained wind speed (mph): 105
Enter current daily temperature (°F): -10
Weather conditions are poor. Abort rocket launch!
java
  • 1 1 Answer
  • 72 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    1 Answer

    • Voted
    • Oldest
    • Recent
    1. ADMIN 2
      ADMIN 2
      2024-07-08T03:11:42+05:30Added an answer on July 8, 2024 at 3:11 am
      This answer was edited.

       

      import java.util.Scanner;
      
      public class RocketLaunch {
          public static void main(String[] args) {
              // Create a Scanner object to read input from the user
              Scanner scanner = new Scanner(System.in);
      
              // Get the sustained wind speed from the user
              System.out.print("Enter sustained wind speed (mph): ");
              double windSpeed = scanner.nextDouble();
      
              // Get the current daily temperature from the user
              System.out.print("Enter current daily temperature (°F): ");
              double temperature = scanner.nextDouble();
      
              // Determine if the launch conditions are safe
              if (windSpeed > 30 || temperature < 41) {
                  // Abort launch if conditions are poor
                  System.out.println("Weather conditions are poor. Abort rocket launch!");
              } else {
                  // Proceed with launch if conditions are good
                  System.out.println("Weather conditions are good. The rocket is go for launch.");
              }
      
              // Close the Scanner object
              scanner.close();
          }
      }
              
        • 0
      • Reply
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    Sidebar

    store ads

    Stats

    • Questions 1k
    • Answers 1k
    • Posts 149
    • Best Answers 89
    • This Free AI Tool Translates Entire Books in Minute !
    • AI News: 🎬 Hollywood’s AI Studios, 🎓 OpenAI’s Latest Gift to Educators, 🚚 Class8 Bags $22M, 🧠 Google Gemini’s Memory Upgrade
    • AI NEWS: Legal Action Against OpenAI, $16M Paid, & Elon Musk’s Praise from Investor 🤖💰📑 | AI Boosts Cloud Seeding for Water Security 🌱💧
    • AI News: 🎬AI Video Tool Scam Exposed🤯, 🛰️ AI-Powered Drones to Ukraine 😱, Google’s $20M AI Push, Sam Altman Joins SF’s Leadership Team
    • AI News: 🤝 Biden Meets Xi on AI Talks, 💡 Xavier Niel’s Advice for Europe, ♻️ Hong Kong’s Smart Bin Revolution, 🚀 AI x Huawei

    Explore

    • Recent Questions
    • Questions For You
    • Answers With Time
    • Most Visited
    • New Questions
    • Recent Questions With Time

    Footer

    SIKSHAPATH

    Helpful Links

    • Contact
    • Disclaimer
    • Privacy Policy Notice
    • TERMS OF USE
    • FAQs
    • Refund/Cancellation Policy
    • Delivery Policy for Sikshapath

    Follow Us

    © 2021-24 Sikshapath. All Rights Reserved

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.