IS187-PROJECT 4 Name _________________.

Added on -2019-09-16

| 3 pages
| 255 words
| 498 views

Trusted by 2+ million users,
1000+ happy students everyday

Showing pages 1 to 1 of 3 pages

IS187-PROJECT 4Name _________________As every resident of Alaska knows, the real enemy in terms of the weather is not the near-zero temperatures, but the wind-chill factor. Meteorologists in Alaska and in many other states give both the temperature and the wind-chill factor. Soimportant is the wind-chill factor that claim air at -40 Fahrenheit is less likely to cause frostbite than air just below freezing that is blowing at gale force. Basically, two factors determine the wind-chill factor: the velocity of wind and the temperature.a. Design an interactive program that accepts from the user a temperature between -20F and 15F and a wind velocity between 5 mph and 30 mph, both in multiples of five. The program should read the temperature.txt file provided to you by your instructor into an array table named windchilltbl – a two dimensional array table. The program prompts the user to enter a temperature between -20F and 15F and a wind velocity between 5 mph and 30 mph, both in multiples of five. Finally, the program looks up the wind-chill factor table in a positional organized table and display the result. The followingis the wind chill factor table, which is also provided in a text file format.TemperatureIn FahrenheitWind Velocity in Miles per Hour51015202530-20-26-46-58-67-74-79-15-21-40-51-60-66-71-10-15-34-45-53-59-64-5-10-27-38-46-51-560-5-22-31-39-44-4950-15-25-31-36-41107-9-18-24-29-331512-3-11-17-22-25b. Create code in Java for the same problem. Demonstrate your Java program at run time by capturing runtime screen shots. You may use the following code to read the temperature.txt file.package project_4;import java.io.File;import java.io.FileNotFoundException;import java.util.Scanner;public class Project_4 {public static void main(String[] args) throws FileNotFoundException {// declare a two dimensional array named windchilltblint [][] windchilltbl=new int[8][6];// declare temperature, velocity, xpos and ypos for the array indexesint temp,vel,xpos,ypos;//declare Scanner variable for console inputScanner scan=new Scanner(System.in); //declare reader to read temperature.txt. You may need to change the file path Scanner reader=new Scanner(new File("C:\\Users\\BA202\\Desktop\\temperature.txt"));//read temperature.txt file and fill the array elements tablefor (int i=0;i<8;i++){for (int j=0;j<6;j++){windchilltbl[i][j]=reader.nextInt();System.out.print(windchilltbl[i][j]+"\t");

Found this document preview useful?

You are reading a preview
Upload your documents to download
or
Become a Desklib member to get accesss

Students who viewed this