Wind Chill Factor Calculator


Added on  2019-09-16

3 Pages255 Words498 Views
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");
Wind Chill Factor Calculator_1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Temperature Recording Program: Java Implementation for Daily and Weekly Temperature Tracking

TCP/UDP Connections: A Comparative Analysis

Work Motivation and Employee Performance: A Study on Air Service Limited in Guyana

Difference between Raw Data Mean and Grouped Data Mean