need help finiding slope and placement for the farenheit in the eaquation for a java.util.Scanner
//GreensboroWarning.java
public class GreensboroWarning{
public static void main (String [] args)throws
java.io.FileNotFoundException{
java.io.File holder= new java.io.File("weatherDaily.txt");
java.util.Scanner read= new java.util.Scanner(holder);
int year, month, day, precipitation, snow, dailyHigh,
dailyLow;
int counterDay=0;
int counterYear=0;// initallize variable to 0
int sumOfYear=0;// initalliaze variable to 0
int yearSquared=0;
double sumAverageLow=0;
double sumYearTAverLow=0;
double fahHigh;
double fahLow=0.0;
double averageLow=0,slope=0;
double slopedegree;
while (read.hasNext()){
year=read.nextInt();// read first integer for year
month=read.nextInt();// read second integer for month
day=read.nextInt();// read third integer for day
precipitation=read.nextInt();
snow=read.nextInt();// fifth for snow
dailyHigh=read.nextInt();//sixth for daily high temp
dailyLow=read.nextInt();// seventh for daily low temp
fahLow+=((9.0* dailyLow)/50.0)+32.0;// change degree to fah
counterDay++;//count the days
if (month==12 && day==31){
averageLow= fahLow/(counterDay*1.0);
System.out.println(year+ " " +averageLow);
counterYear++;
sumOfYear+=year;
yearSquared+=year * year;
sumAverageLow+=averageLow;
sumYearTAverLow+=year*averageLow;
counterDay=0;
fahLow=0;
}
}
slope=(counterYear*sumYearTAverLow-sumOfYear*sumAverageLow)/(counterYear*
yearSquared -sumOfYear*sumOfYear);// calculate temp
System.out.println("increase in annual low is "+slope+ " degrees
per year");// display the temperture
slopedegree=(1/slope);
System.out.println(+slopedegree+"years to change one
degree");
}
}
=========================================================================
sample output
need help finiding slope and placement for the farenheit in the eaquation for a java.util.Scanner COMP163...
1. Write a C++ program that reads daily weather observation data from a file and writes monthly and annual summaries of the daily data to a file. a. The daily weather data will be contained in a file named wx_data.txt, with each line of the file representing the weather data for a single day. b. For each day, the date, precipitation amount, maximum temperature, and minimum temperature will be provided as tab-separated data with the following format: 20180101 0.02 37...
Assume that, for a given town, mid-day daily temperature in Fahrenheit was measured for a month and stored in a file called temperature.txt. Write a complete C Language program that reads the stored temperatures, one at a time, from the file temperature.txt and converts the read temperature to its equivalent in Celsius. Your program should store each converted temperature in an output file called results.txt. Your program should find the average, the minimum, and the maximum temperatures in Celsius and...
Assume that, for a given town, mid-day daily temperature in Fahrenheit was measured for a month and stored in a file called temperature.txt. Write a complete C language program that reads the stored temperatures, one at a time, from the file temperature.txt and converts the read temperature to its equivalent in Celsius. Your program should store each converted temperature in an output file called results.txt. Your program should also find the average, the minimum, and the maximum temperatures in Celsius...
Hello, I am having some difficulty with interpreting the data below to fill in the table required (which is displayed below the data charts). Any help or advice would be greatly appreciated. Question: Fill in the following table based upon the data charts given Question 2005 2006 2007 2008 For each year, at what date did the water temperature first hit 1°C above expected summertime maximum? For each year, at what date did the water temperature first hit 2°C above...
On this project you will make calculations and conclusions based on real data collected by the NOAA (The National Oceanic and Atmospheric Administration, an agency of the United States government) on the “Daily Lake Average Surface Water Temperature” of six lakes (Ontario, Erie, Huron, Michigan, Superior, and St. Clair) during the 2019 calendar year. You can find the actual data file here that contain the average temperatures for each day of the year for each of the six lakes. Data...
Hello! I have this python Homework due tonight that I don't know how to do. Here is a document with the data in the csv file, as I didn't know how to share it https://docs.google.com/document/d/1bDJVR2MqWKInvw5u0r3fOG3-CBmu3BEiPZwlaq_CShQ/edit?usp=sharing Activity #3: On the class website is a CSV file containing weather data from Coulter Field (in Bryan) for 3 years (1 day is missing for some reason!); the data was taken from Weather Underground (wunderground.com). There are different versions of the file for Windows...
i need help using python ( spyder) only use files , loops if needed is statement do not use , def function or any other. Exercise 1: Daily temperature is recorded for some weeks in files (templ.txt", temp2.txt, and temp3.txt; provided in the MOODLE). The first line contains number of weeks and the rest of the lines each represent the week number followed by temperature on the seven days of that week (see samples input files below). Write a python...
Please Read it all and carefully In visual basic(vba)do the following program Summary INGE Industry, Inc. needs a program in which the date and temperature in Celsius degrees of an industry laboratory are recorded and stored in a sequential file. In addition, you can see the recorded data and convert the temperatures in the following units: Fahrenheit, Kelvin and Rankine. In addition, they want to see a linear graph that reflects how the temperature has fluctuated day by day, for...
C++: Need help debugging my code I am writing this and using some other examples as reference code while rewriting it with my own understanding of the material but am having trouble making it finally compile. Below is a picture of the error messages. //main.cpp //Semester Project //Created by J---on 5/6/2019 #include <iostream> #include <fstream> #include <string> #include <sstream> #include <bits/stdc++.h> using namespace std; void instructions(); //displays program details and instructions void openFile(); void takeInput(int*); void switchBoard(int*); struct price {...
The following is a program from Starting out with C++ by Toni Gaddis. I am getting the following error messages pertaining to the lines: cin>>month[i].lowTemp; and months[i].avgTemp = (months[i].highTemp + month[i].lowTemp)/2; The error messages read as follows: error C2039: 'lowTemp': is not a member of 'std::basic_string<_Elem,_Traits,_Ax>' and it continues. The second error message is identical. The program is as follows: Ch. 11, Assignment #3. pg. 646. Program #4. //Weather Statistics. //Write a program that uses a structure to store the...