Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a java program named temperature.java. This program should contain the following three methods: o A method named tempC2F that accepts a temperature value in
Create a java program named temperature.java. This program should contain the following three methods: o A method named tempC2F that accepts a temperature value in degrees Celsius and returns the equivalent temperature value in degrees Fahrenheit. See formula, below o A method named tempF2C that accepts a temperature value in degrees Fahrenheit and returns the equivalent temperature value in degrees Celsius. See formula, below o A method named windchill that accepts a temperature value in degrees Fahrenheit and a wind speed value in miles per hour and returns the calculated wind chill factor for those parameters. See formula, below o From the main method, your program must print a menu to the terminal which provides the user with four options exactly as follows: Enter a letter for one of the following options: C to Convert a Celsius temperature to a Fahrenheit temperature, F to convert a Fahrenheit temperature to a Celsius temperature, W to calculate a wind chill factor, Q to exit the application. Instructions: - Your program should consider either lower-case entry or upper-case entry as valid entry from the user: i.e. (C or c, Forf, W or w, Qora) After the user select a letter, your program must request the appropriate data from the user according to the option selected then perform the selected operation. Example: if a user selects C, your program will prompt the user to enter the Celsius temperature...etc. Assume the data entered by the user is valid numerical value. Using printf method, your program must display the result to the user exactly as follows (based on the user selected operation). C Celsius is F Fahrenheit F Fahrenheit is C Celsius When temperature is F Fahrenheit and wind speed is W, wind chill factor is Z Where C, F, W, & Z are the values of Celsius, Fahrenheit, Wind speed, Wind chill factor respectively. If the user selects to exit the program, your program should print out the following statement Exiting... have a nice day! If the user enters anything that is not one of the four menu options, your program should print the following statement Incorrect entry, program terminated! You should include some comments within your code. You can't use IF statement in any part of your program Formulas: To convert between Fahrenheit (F) and degrees Celsius (C): Tc = (5/9) (T1-32) T = 32 +(9/5) T. Where: Tc is temperature in Celsius & Tf is temperature in Fahrenheit Wind chill = 91.4 ((91.4 T) (0.478 + (0.301 x WW) - (0.02 x W))) Where: W (wind speed) is in mph T (Temperature) is in F
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started