Menu

(Solved) : Import Javaio Import Javatextdecimalformat Import Javaxswingjoptionpane Public Class Tempe Q44172114 . . .

import java.io.*; import java.text.DecimalFormat; import javax.swing.JOptionPane; public class Temperature public static voidDE VERO ELVES float t = convert Temp (temp); displayResults(feedback, feedback2); public static double calcAverage (double[]BCIS 3680 Enterprise Programming Instructor: Dr. Andy Wu Assignment 1 In this exercise, you will build a simple application tThe above screenshot is just an example based on a set of temperatures I entered. When using your application, the results sh6. Note that the Fahrenheit and Celcius output are precise to two decimal places. To perform this formatting, use the Decimal

Help me with my code?

BOIS 3680 Enterprise Programming Instructor: Dr. Andy Wu Assignment 1 In this is you will build a simple application that calThe above what is an example b on atomers and When application the should be dynamic and det for den som will For now in factTo test the Far Celsius conversion you can some of the following value Description sering C result formatted 0.00 Water boiliimport java.io.*; import java.text.DecimalFormat; import javax.swing.JOptionPane; public class Temperature public static void main(String[] args) final int wkdays = 7; String[] days = {“Monday’s”, “Tuesday’s”, “Wednesday’s”, “Thursday’s”, “Friday’s”, “Saturday’s”, “Sunday’s”}; String input = null; double feedback; double feedback2; double[] temp = new double[wkdays]; for (int d = 0; d <days.length; d++) input = JOptionPane.showInputDialog(“Please enter:” + days[d] + “temperature in Fahrenheit.”); temp[d] = Double.parseDouble(input); d++; double average = calcAverage (array); float t = convertTemp (temp); DE VERO ELVES float t = convert Temp (temp); displayResults(feedback, feedback2); public static double calcAverage (double[] array) double total = 0.0; double average; for (int index = 0; index < array.length; index++) total += array[index]; average = total / array.length; return average; public static float covertTemp (double temp[]) float t = 0; for (int index = 0; index < array.length; index++) t = (float) ((temp[i]-32)*5)/9; return t; private static void displayResults(double feedback, double feedback2) JOptionPane.showMessageDialog(null, “The average temperature this week was: ” + (String.format(“%.1f”, feedback)) + “degrees in Fahrenheit.” + “which is” + (String.format(“%.1f”, feedback2)) + “degrees Celsius.”); BCIS 3680 Enterprise Programming Instructor: Dr. Andy Wu Assignment 1 In this exercise, you will build a simple application that calculates the weekly average of temperatures and then converts it from Fahrenheit to Celsius. The application works as follows: 1. When the application starts, it asks for Monday’s temperature: TempApp ? Please enter Monday’s temperature in Fahren OK Cancel 2. After you enter Monday’s temperature, another dialog box appears, asking for Tuesday’s temperature: TempApp 2 Please enter Tuesday’s temperature in Fahrenheit. OK Cancel 3. This process will continue for the other days in a week, with the last dialog box asking for Sunday’s temperature: TempApp 2 Please enter Sunday’s temperature in Fahrenheit. OK Cancel 4. Afterwards, the program calculates the weekly average and converts it to Celsius. It then displays the results: X TempApp The weekly average temperature was 99.00 degrees Fahrenheit. which was 37.22 degrees Celsius. ok BCIS 3680 Enterprise Programming Assignment 1-1 The above screenshot is just an example based on a set of temperatures I entered. When using your application, the results should be dynamic and different for every different set of temperatures. For now in fact, for most of the semester) let’s assume a user will enter a legitimate value at the blinking cursor. In other words, expect the user to enter a numeric value rather than “seventy”, a reasonable temperature value rather than 1000000000000000000000000, etc. To write the application, you will apply what you have learned about methods and arrays. The following are the specifications of the application: 1. Use a double array to store the seven daily temperature values. 2. Besides the main() method, write the following three methods. The data types of your parameter(s) and return value, if any, must match what are described in the following table. That is, if a double value is specified here, declare your parameter/return type as such. Method Name Function Input Output The seven daily temperatures stored in a double array. The weekly average as a double value. Fahrenheit value as a double. Celsius value as a float. calcAverage Calculates the weekly average temperature. convert Temp Converts temperature from Fahrenheit to Celsius. displayResults Displays a dialog box showing the calculation and conversion results. A dialog box showing the results. 1. Weekly average temperature in Fahrenheit as a double, and 2. Its Celsius equivalent as a float. 3. The weekly average is a simple average of the seven daily ones, i.e., total divided by 7. 4. The formula for Fahrenheit to Celsius conversion is: (F-32)(5) 5. To test the Fahrenheit to Celsius conversion, you can use some of the following values: Description °C (result, formatted) °F(user input, unformatted) 212 98.6 32 Water boiling point Body temperature Water freezing point Mixing ice and ammonium chloride Convergence point Center of the sun 100.00 37.00 0.00 -17.78 -40.00 14,999,982.00 0 -40 27000000 BCIS 3680 Enterprise Programming Assignment 1-2 6. Note that the Fahrenheit and Celcius output are precise to two decimal places. To perform this formatting, use the DecimalFormat class. Declare a DecimalFormat object and use its related method if necessary. 7. You must use method names exactly as listed above. Failure to do so may cause point deduction. You may use names of your choice for local variables in the methods. However, you should follow the proper Java naming convention. Submission Due Date: 11:59 PM on Saturday, February 1, 2019 Submission Requirements: • No hard copy is required. Create a folder and name it 3680-HN1 – YourLastName-YourFirstName. Copy both your source code file (java) AND the compiled file (.class) file to the folder. • Zip your into 3680-HW1-YourLastName-YourFirstName.zip (RAR is fine too). . Submit the zip file as an attachment on Blackboard. • Failure to comply with these requirements will cause point deduction. BCIS 3680 Enterprise Programming Assignment 1-3 BOIS 3680 Enterprise Programming Instructor: Dr. Andy Wu Assignment 1 In this is you will build a simple application that calculates the weekly average of temperatures and then converts it from Fahrenheit Celsius. The application works as follows 1. When the application starts, it asks for Monday’s temperature 2. After your ember Monday’s temperature, another dialog box appar, asking for Today’s temperature 7 w This process will continue for the other days in a week, with the last dialog box asking for Sunday’s temperatures 4. Afterwards, the program calculates the weekly average and convert it to Celsius. It then displays the results: The above hot is just an example bandonato imperatures entered. When using your application, the results should be dynamic and different for every different set of temperatures For new in fact, for most of the semester) let’s assume a user will enter a legitimate value at the blinking cursor. In other words, expect the user to enter a numeric value rather than seventy”. reasonable p revaluate than 1000000000000000000000000, To write the application you will apply what you have med about methods and arrays. The following are the specifications of the application 1. Use a double array to show the wven daily temperature values 2. Besides the saint method, write the following three methods. The data types of your parameters and return value, if any, must match what are described in the following table. That is if a double value is specified here, declare your parameterum type as such The above what is an example b on atomers and When application the should be dynamic and det for den som will For now in fact of them inking in other words expect the c we o m m m a t the e rather than eventy To write the application you will apply what you have leamed about methods and anys. The and match what a decidithe That Input Out calderage Calculate the way The seven daily temperatures The w ave Conversemeure Fahrenheit v as a double C a sa displaysulta Displays a dialog box showing the calculation and conversion results. 1 Weekly average temperature Aditog box showing in Fahrenhet me down and the results 2. Its Celsius equivalent as a The weekly average is a simple average of the seven daily nese total divided by 7 Celsius conversion is 4. The formula for Fahrenheit 325) To test the Fahrenheit to Celsius conversion, you can use some of the following values Description C result formatted 37.00 Water boiling point Body temperature Water resting point Mixing ice and ammonium chloride Convergence point Center of the sun 4000 27000000 n Nathathe forming methode preciowe decimal places. Te perform this salorada Declare a Decimomatect and use its related the 7. You must method names atly as listed above Failure to do so may cause pot dedim You may w ames of your choice for local varies in the methods. However, you should follow the properava naming met Submission To test the Far Celsius conversion you can some of the following value Description sering C result formatted 0.00 Water boiling point Body temperature Wat treening point Mixing and ammonium corde Convergence point Center of the sun 27000000 14.999.92.00 Note that the Fa t and Caicos output precies we decimal place. To perform the formatting the Declarat dass Declare a Decimal t object and use it lated methodecar. You must use method names exactly as listed above Failure to do so may cause point deduction You may w ames of your choice for local variables in the methods. However, you should follow the programming convention Submission Due Date: 11:59 I’M on Saturday, February 1, 2019 Submission Regi s • Na handy is required • Create a folder and name it 3600-ww YourLaste-Your Name Copy both your W e code file (java) AND the file class file to the folder • Zip your into 360-W-YourLastName Your FirstName sip (RAR is fine tool • Saithe zip file as an attachmen Blackboard • Failure to comply with the requirements will cause point deduction 3 of 3 Show transcribed image text import java.io.*; import java.text.DecimalFormat; import javax.swing.JOptionPane; public class Temperature public static void main(String[] args) final int wkdays = 7; String[] days = {“Monday’s”, “Tuesday’s”, “Wednesday’s”, “Thursday’s”, “Friday’s”, “Saturday’s”, “Sunday’s”}; String input = null; double feedback; double feedback2; double[] temp = new double[wkdays]; for (int d = 0; d

Expert Answer


Answer to import java.io.*; import java.text.DecimalFormat; import javax.swing.JOptionPane; public class Temperature public static…

OR