Question

F910 F1112 F F2 F3 10 Points) Question 6 center, a closed low- A tropical cyclone is a rapidly rotating storm system characte
0 0
Add a comment Improve this question Transcribed image text
Answer #1

The below program reads the storm Ids and Wind speed from a file and categorizes them after calculating the wind KTS

import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Scanner;

public class stormConverter {


   public static void main(String[] args) throws IOException {
       // TODO Auto-generated method stub
      
       Path path = Paths.get("C:\\Users\\msounda6\\Projects\\Cg\\storm.txt");

       //Using scanner to read the input from File
       Scanner scanner = new Scanner(path);
      
       System.out.println("Read text file using Scanner");
       //read line by line
       String [] tempArray = new String[3];
       int windSpeed;
       double windKts;
       String category="";

       while(scanner.hasNextLine()){
            //process each line
           String line = scanner.nextLine();
           tempArray=line.split(" ");
           windSpeed=Integer.parseInt(tempArray[1]);
          
           //Calculate the windKts
           windKts = 0.539957*windSpeed;
          
           //Categorize based on Wind Kts
           if (windKts>=120)
               category="Super Cyclonic Storm";
           else if (windKts>=90 && windKts<120)
               category="Extremely Severe Cyclonic Storm";
           else if (windKts>=64 && windKts<90)
               category="Very Severe Cyclonic Storm";
           else if (windKts>=48 && windKts<64)
               category="Severe Cyclonic Storm";
           else if (windKts>=34 && windKts<48)
               category="Cyclonic Storm";
           else if (windKts>=28 && windKts<34)
               category="Deep Depression";
           else if (windKts>=17 && windKts<28)
               category="Depression";
          
           System.out.print(line+"\t"+category+"\n");
       }
       scanner.close();

   }

}

Add a comment
Know the answer?
Add Answer to:
F910 F1112 F F2 F3 10 Points) Question 6 center, a closed low- A tropical cyclone is a rapidly rotating storm system characterized b) level atmospheric circulation, strong winds, and a spiral arr...
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
  • A rapidly rotating storm system characterized by a low-pressure center, a closed low-level atmospheric circulation, strong...

    A rapidly rotating storm system characterized by a low-pressure center, a closed low-level atmospheric circulation, strong winds, and a spiral arrangement of thunderstorms that produce heavy rain is known as a _______. 1- sharknado 2- hurricane 3- tornado 4- frontal system 2)What general cloud shape is pictured below? 1- nimbo-form 2-cirro-form 3- strato-form 4-cumulo-form. 3)Which layer of the atmosphere extends between 50 km to 85 km above Earth's surface and is where most meteor burn up in the sky? 1-...

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