Description
Please read the question first, and please u must know the book that we are taking it's Starting Out with Visual C# please if u do not know the book not do it.
The question down with files plus every thing u want u will find it down also thanks.
Unformatted Attachment Preview
Write a program to do the following:
Read the data from the file named 1975-1979.csv located in the I:\kopploutbox\CS 313 01\Final
Project folder. The data is in the format and separated by commas:
Date - month/day/year
State - string
Fujita (tornado strength) - integer
Fatalities - integer
Injuries - integer
You decide how you want to store the data but it must be in a form that has been discussed in
either CS 165 or CS 313.
Convert the date field into a string with the format yyyymmdd
Convert all the integer fields listed above from string to integer
For the data read into your program, complete the following 4 tasks:
Display the number of fatalities for a specified state
Display the number of injuries for a specifed Fujita
Display the Fujita rating with the highest number of fatilites
Display the state with the most Injuries
O
O
O
Program requirements.
1. All code must be from CS 165 or CS 313
2. You are required to use at least 2 forms. You determine how to use them
3. If you do not use the specified file or complete the 4 tasks mentioned above, major points will
be subtracted
4. Do your own work. Any work turned in that appears to be completed by multiple students will
receive a grade of 0.
Purchase answer to see full attachment
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Explanation & Answer
Review
Review
Anonymous
I use Studypool every time I need help studying, and it never disappoints.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Most Popular Content
5 pages
User Interface
1. Working with users of the application; the best people to work with during prototyping are those people who will finall ...
User Interface
1. Working with users of the application; the best people to work with during prototyping are those people who will finally use the system when the ...
CSE 230 UART String Conversion MIPS
Create modular code and interface with unfamiliar modularized code The Task In this project, you will be writing a progra ...
CSE 230 UART String Conversion MIPS
Create modular code and interface with unfamiliar modularized code The Task In this project, you will be writing a program that converts a string to an integer (similar to Java’s Integer.parseInt() method or Python’s int() function). You program will receive ASCII strings from the UART, one character at a time. It should convert each string of characters into an integer value that is passed to a provided print function. Strings will be terminated using a semicolon (;) character and will contain one or more characters in addition to the semicolon. Your program should be able to handle multiple strings concatenated together and treat each string ending with a ‘;’ as a separate input. When processing strings, it should detect any invalid characters within a string. Invalid characters are any characters other than ‘0’ through ‘9’ and ‘;’. If an invalid character is detected then the rest of the string (i.e. all characters leading up to and including the next ‘;’) should be received by the UART, but ignored. Your program should then use the print function to output an error message and then continue processing the next string as a new string. Print Function A skeleton PLP project file is available to download on Blackboard. The PLP project includes a second ASM file titled, project3_print.asm. This ASM file contains the print function used in this project. PLPTool concatenates all ASM files within a PLP project into a single location in memory (unless additional .org statements have been added to specify different location for code). No changes to project3_print.asm should be made. When called, the print function will send the value currently in register $a0 over the UART to the PLPTool simulated UART device. Register $a1 is used as an invalid character flag for the print function. If $a1 register contains a non-zero value, the print function will display an invalid character message instead of the value in register $a0. The print function is called using the following instruction: call project3_print To use the print function, your PLP program needs to initialize the stack pointer ($sp) before performing the function call (or any other operations involving the stack pointer). For this reason, the skeleton project file includes an initialization that sets the stack pointer to 0x10fffffc (the last address of RAM). This initialization only needs to be done once at the start of the program. Deliverables: 1. Take the Project 3 Pre Quiz on Blackboard (3 points) 2. Submit your program on Blackboard with the format: lastname_project3.plp (25 points) Note: Please do not zip the project file or include any additional files in your submission 3. Take the Project 3 Post Quiz on Blackboard
MCC Weather Generator Produces Synthetic Time Series of Weather Data Java Task
A weather generator produces a “synthetic” time series of weather data for a location based on
the statistical charact ...
MCC Weather Generator Produces Synthetic Time Series of Weather Data Java Task
A weather generator produces a “synthetic” time series of weather data for a location based on
the statistical characteristics of observed weather at that location. You can think of a weather
generator as being a simulator of future weather based on observed past weather. A time series is
a collection of observations generated sequentially through time. The special feature of a time
series is that successive observations are usually expected to be dependent. In fact, this dependence
is often exploited in forecasting.
Since we are just beginning as weather forecasters, we will simplify our predictions to just
whether measurable precipitation will fall from the sky. If there is measurable precipitation,
we call it a “wet” day. Otherwise, we call it a “dry” day.
Weather Persistence
To help with understanding relationships and sequencing events through time, here’s a simple
pseudocode that shows what it means for precipitation to be persistent from one day to the next.
READ "Did it rain today?"
IF answer is yes THEN
There is a greater chance that tomorrow will be wet rather than dry
ELSE
There is a greater chance that tommorrow will be dry rather than wet
ENDIF
This one from the UK has graphics that are supportive of the idea of persistence (though that word is not used).
As you watch it, consider that whatever is causing weather today (high pressure and a warm mass of air
creating a sunny, warm day or low pressure and a cool mass of air creating a cloudy, cool day) is possibly
still going to be affecting weather tomorrow. This is the idea of persistence.
Time of year and location
Weather data depends on both the time of year and the location. This means that the probabilities
used in the simulation need to be associated with both a location and a time of year.
The table below lists the probabilities that a day will be wet given that the previous day was dry
for each month for a weather station near Norman, OK. This table gives the probability of a change
from dry to wet. These are “real” numbers that reflect how often the weather changed from dry to wet
in that specific location, during the month indicated, over the 30-year period from 1970-2000.
JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember0.270.330.400.460.430.280.120.170.230.210.280.27
The next table lists the probabilities that a day will be wet given that the previous day was wet for
the same weather station near Norman, OK. This table gives the probability that the weather remains
wet from one day to the next.
JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember0.550.580.610.690.730.620.450.550.580.550.590.55
Armed with these probabilities, we can turn our simulation into a weather generator for this location.
Here’s what it would look like for July in Norman, OK.
READ "Did it rain today?"
IF answer is yes THEN
READ a random value between 0 and 1
IF the random value is less than or equal to 0.45 THEN
No change! It is a wet day
ELSE
Change! It is a dry day
ENDIF
ELSE
READ a random value between 0 and 1
IF the random value is less than or equal 0.12 THEN
Change! It is a wet day
ELSE
No change! It is a dry day
ENDIF
ENDIF
A common practice would be to use a random number generator to generate some value between 0 and 1. If the
random value is less than .88, then there would be no change, and if it is greater than .88 then the weather
changes to rain.
If it’s a wet day, we want to simulate “no change” 45% of the time and “change” 55% of the time. To do this
with our random number generator, we say there is “no change” if random number is less than .45 and a change
to dry if it is greater.
Weather generator
Now it’s time to generate some weather!
Imagine you are a farmer. Does knowing the number of wet or dry days tell the whole story? Would the pattern
be important? If so, what pattern would you like to see? How would you measure this pattern?
The transition probabilities that we have used for Norman, OK are based on historical data, and you might
use them to get a sense for the likelihood certain weather phenomena in the near future. For instance, a
farmer might want to run many, many simulations to get an idea of the likelihood of going 20 or more days
without rain, and the results might influence the crops that he or she plants.
Just as we can base the transition probabilities on historical data, we can also base them on future predictions.
For instance, the National Center for Atmospheric Research (NCAR) simulates weather as it responds to assumptions
about how various “forcings” (e.g, greenhouse gasses) will evolve in the future. Typically, these models couple
an atmospheric model with an ocean model, but more recent versions, the so-called Earth system models, incorporate
more components including land use, sea and land ice, etc. The models can be used to predict future precipitation
patterns and transition probabilities that are based on these forecasts, rather than past data.
The weather generator methods you will be writing for this assignment will:
predict future precipitation pattern for one month: oneMonthGenerator
find the number of wet or dry days in a given month’s forecast: numberOfWetDryDays
find the longest wet or dry spell in a given month’s forecast: lengthOfLongestWetDrySpell
Future transition probability table as a 2D array
The oneMonthGenerator method receives as arguments the transition probability tables (dry to wet, and wet to wet) as 2D arrays.
Each table row corresponds to a location (longitude, latitude) in the USA and contains the transition probabilities
for each month of the year.
LongitudeLatitudeJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember-97.5826.020.760.750.770.740.800.860.940.970.890.770.740.77
Following are the methods to be completed in WeatherGenerator.java:
public class WeatherGenerator {
/* Given a location (longitude, latitude) in the USA and a month of the year, the method
* returns the forecast for the month based on the drywet and wetwet transition
* probabilities tables.
*
* month will be a value between 2 and 13: 2 corresponds to January, 3 corresponds to February
* and so on. These are the column indexes of each month in the transition probabilities tables.
*
* The first day of the month has a 50% chance to be a wet day, 0-0.49 (wet), 0.50-0.99 (dry)
*
* Use StdRandom.uniform() to generate a real number uniformly in [0,1)
*/
int[] oneMonthGenerator(double longitute, double latitude, int month, double[][] drywet, double[][] wetwet)
// Returns the longest number of consecutive mode (WET or DRY) days in forecast.
int numberOfWetDryDays (int[] forecast, int mode)
/*
* Analyzes the forecast array and returns the longest number of
* consecutive mode (which can be WET or DRY) days in forecast.
*/
int lengthOfLongestWetDrySpell (int[] forecast, int mode)
}
Use the main method as a driver to test your methods. To generate the weather for location at longitude -98.76 and latitude 26.70 for the month of February do:
java WeatherGenerator111 -98.76 26.70 3
public static void main (String[] args) {
int numberOfRows = 4001; // Total number of locations
int numberOfColumns = 14; // Total number of 14 columns in file
// File format: longitude, latitude, 12 months of transition probabilities
// Allocate and populate arrays that hold the transition probabilities
double[][] drywet = new double[numberOfRows][numberOfColumns];
double[][] wetwet = new double[numberOfRows][numberOfColumns];
populateTransitionProbabilitiesArrays(drywet, wetwet, numberOfRows);
/*** WRITE YOUR CODE BELLOW THIS LINE. DO NOT erase any of the lines above. ***/
// Read command line inputs
double longitute = Double.parseDouble(args[0]);
double latitude = Double.parseDouble(args[1]);
int month = Integer.parseInt(args[2]);
int[] forecast = oneMonthGenerator(longitute, latitude, month, drywet, wetwet);
int drySpell = lengthOfLongestSpell(forecast, DRY);
int wetSpell = lengthOfLongestSpell(forecast, WET);
StdOut.println("There are " + forecast.length + " days in the forecast for month " + month);
StdOut.println(drySpell + " days of dry spell.");
for ( int i = 0; i < forecast.length; i++ ) {
// This is the ternary operator. (conditional) ? executed if true : executed if false
String weather = (forecast[i] == WET) ? "Wet" : "Dry";
StdOut.println("Day " + (i+1) + " is forecasted to be " + weather);
}
}
Similar Content
Make a schematic of a complete system showing how it is connected with peripherals and wired Internet connection, programming homework help
Make a schematic of a complete system showing how it is connected with peripherals and wired Internet connection....
program
Draw a flow chart to check whether the given number is prime or not,...
Keyword search program using multi-thread Discussion
Project DescriptionYou will design and implement a keyword search program called ks_bb, which will take two command line...
University of Bridgeport Responsive Layout Programming Paper
Build on the site using Node.js and Express.js, all of the function was done, but just lack of Responsive Layout.Use Boots...
This is what I was referring to.
FIle.docx ...
Restaurant System in Java Project Implementation and Design
Has to be done using Java 1.8...
Coding
void write_client_msg(int cli_sockfd, char * msg) void write_client_int(int cli_sockfd, int msg) void write_clients_msg(in...
Ism530lab7assessmentworksheet
In this lab, you created a basic Linux file directory with subdirectories. You also changed the ownership of a directory t...
Assignment Solution
...
Related Tags
Book Guides
The Knife of Never Letting Go
by Patrick Ness
Gone with the Wind
by Margaret Mitchell
Steppenwolf
by Hermann Hesse
No Exit
by Taylor Adams
Faust
by Johann Wolfgang von Goethe
The Chosen
by Chaim Potok
The Catcher in the Rye
by J. D. Salinger
Divergent
by Veronica Roth
Extreme Ownership - How US Navy SEALs Lead and Win
by Jocko Willink and Leif Babin
Get 24/7
Homework help
Our tutors provide high quality explanations & answers.
Post question
Most Popular Content
5 pages
User Interface
1. Working with users of the application; the best people to work with during prototyping are those people who will finall ...
User Interface
1. Working with users of the application; the best people to work with during prototyping are those people who will finally use the system when the ...
CSE 230 UART String Conversion MIPS
Create modular code and interface with unfamiliar modularized code The Task In this project, you will be writing a progra ...
CSE 230 UART String Conversion MIPS
Create modular code and interface with unfamiliar modularized code The Task In this project, you will be writing a program that converts a string to an integer (similar to Java’s Integer.parseInt() method or Python’s int() function). You program will receive ASCII strings from the UART, one character at a time. It should convert each string of characters into an integer value that is passed to a provided print function. Strings will be terminated using a semicolon (;) character and will contain one or more characters in addition to the semicolon. Your program should be able to handle multiple strings concatenated together and treat each string ending with a ‘;’ as a separate input. When processing strings, it should detect any invalid characters within a string. Invalid characters are any characters other than ‘0’ through ‘9’ and ‘;’. If an invalid character is detected then the rest of the string (i.e. all characters leading up to and including the next ‘;’) should be received by the UART, but ignored. Your program should then use the print function to output an error message and then continue processing the next string as a new string. Print Function A skeleton PLP project file is available to download on Blackboard. The PLP project includes a second ASM file titled, project3_print.asm. This ASM file contains the print function used in this project. PLPTool concatenates all ASM files within a PLP project into a single location in memory (unless additional .org statements have been added to specify different location for code). No changes to project3_print.asm should be made. When called, the print function will send the value currently in register $a0 over the UART to the PLPTool simulated UART device. Register $a1 is used as an invalid character flag for the print function. If $a1 register contains a non-zero value, the print function will display an invalid character message instead of the value in register $a0. The print function is called using the following instruction: call project3_print To use the print function, your PLP program needs to initialize the stack pointer ($sp) before performing the function call (or any other operations involving the stack pointer). For this reason, the skeleton project file includes an initialization that sets the stack pointer to 0x10fffffc (the last address of RAM). This initialization only needs to be done once at the start of the program. Deliverables: 1. Take the Project 3 Pre Quiz on Blackboard (3 points) 2. Submit your program on Blackboard with the format: lastname_project3.plp (25 points) Note: Please do not zip the project file or include any additional files in your submission 3. Take the Project 3 Post Quiz on Blackboard
MCC Weather Generator Produces Synthetic Time Series of Weather Data Java Task
A weather generator produces a “synthetic” time series of weather data for a location based on
the statistical charact ...
MCC Weather Generator Produces Synthetic Time Series of Weather Data Java Task
A weather generator produces a “synthetic” time series of weather data for a location based on
the statistical characteristics of observed weather at that location. You can think of a weather
generator as being a simulator of future weather based on observed past weather. A time series is
a collection of observations generated sequentially through time. The special feature of a time
series is that successive observations are usually expected to be dependent. In fact, this dependence
is often exploited in forecasting.
Since we are just beginning as weather forecasters, we will simplify our predictions to just
whether measurable precipitation will fall from the sky. If there is measurable precipitation,
we call it a “wet” day. Otherwise, we call it a “dry” day.
Weather Persistence
To help with understanding relationships and sequencing events through time, here’s a simple
pseudocode that shows what it means for precipitation to be persistent from one day to the next.
READ "Did it rain today?"
IF answer is yes THEN
There is a greater chance that tomorrow will be wet rather than dry
ELSE
There is a greater chance that tommorrow will be dry rather than wet
ENDIF
This one from the UK has graphics that are supportive of the idea of persistence (though that word is not used).
As you watch it, consider that whatever is causing weather today (high pressure and a warm mass of air
creating a sunny, warm day or low pressure and a cool mass of air creating a cloudy, cool day) is possibly
still going to be affecting weather tomorrow. This is the idea of persistence.
Time of year and location
Weather data depends on both the time of year and the location. This means that the probabilities
used in the simulation need to be associated with both a location and a time of year.
The table below lists the probabilities that a day will be wet given that the previous day was dry
for each month for a weather station near Norman, OK. This table gives the probability of a change
from dry to wet. These are “real” numbers that reflect how often the weather changed from dry to wet
in that specific location, during the month indicated, over the 30-year period from 1970-2000.
JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember0.270.330.400.460.430.280.120.170.230.210.280.27
The next table lists the probabilities that a day will be wet given that the previous day was wet for
the same weather station near Norman, OK. This table gives the probability that the weather remains
wet from one day to the next.
JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember0.550.580.610.690.730.620.450.550.580.550.590.55
Armed with these probabilities, we can turn our simulation into a weather generator for this location.
Here’s what it would look like for July in Norman, OK.
READ "Did it rain today?"
IF answer is yes THEN
READ a random value between 0 and 1
IF the random value is less than or equal to 0.45 THEN
No change! It is a wet day
ELSE
Change! It is a dry day
ENDIF
ELSE
READ a random value between 0 and 1
IF the random value is less than or equal 0.12 THEN
Change! It is a wet day
ELSE
No change! It is a dry day
ENDIF
ENDIF
A common practice would be to use a random number generator to generate some value between 0 and 1. If the
random value is less than .88, then there would be no change, and if it is greater than .88 then the weather
changes to rain.
If it’s a wet day, we want to simulate “no change” 45% of the time and “change” 55% of the time. To do this
with our random number generator, we say there is “no change” if random number is less than .45 and a change
to dry if it is greater.
Weather generator
Now it’s time to generate some weather!
Imagine you are a farmer. Does knowing the number of wet or dry days tell the whole story? Would the pattern
be important? If so, what pattern would you like to see? How would you measure this pattern?
The transition probabilities that we have used for Norman, OK are based on historical data, and you might
use them to get a sense for the likelihood certain weather phenomena in the near future. For instance, a
farmer might want to run many, many simulations to get an idea of the likelihood of going 20 or more days
without rain, and the results might influence the crops that he or she plants.
Just as we can base the transition probabilities on historical data, we can also base them on future predictions.
For instance, the National Center for Atmospheric Research (NCAR) simulates weather as it responds to assumptions
about how various “forcings” (e.g, greenhouse gasses) will evolve in the future. Typically, these models couple
an atmospheric model with an ocean model, but more recent versions, the so-called Earth system models, incorporate
more components including land use, sea and land ice, etc. The models can be used to predict future precipitation
patterns and transition probabilities that are based on these forecasts, rather than past data.
The weather generator methods you will be writing for this assignment will:
predict future precipitation pattern for one month: oneMonthGenerator
find the number of wet or dry days in a given month’s forecast: numberOfWetDryDays
find the longest wet or dry spell in a given month’s forecast: lengthOfLongestWetDrySpell
Future transition probability table as a 2D array
The oneMonthGenerator method receives as arguments the transition probability tables (dry to wet, and wet to wet) as 2D arrays.
Each table row corresponds to a location (longitude, latitude) in the USA and contains the transition probabilities
for each month of the year.
LongitudeLatitudeJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember-97.5826.020.760.750.770.740.800.860.940.970.890.770.740.77
Following are the methods to be completed in WeatherGenerator.java:
public class WeatherGenerator {
/* Given a location (longitude, latitude) in the USA and a month of the year, the method
* returns the forecast for the month based on the drywet and wetwet transition
* probabilities tables.
*
* month will be a value between 2 and 13: 2 corresponds to January, 3 corresponds to February
* and so on. These are the column indexes of each month in the transition probabilities tables.
*
* The first day of the month has a 50% chance to be a wet day, 0-0.49 (wet), 0.50-0.99 (dry)
*
* Use StdRandom.uniform() to generate a real number uniformly in [0,1)
*/
int[] oneMonthGenerator(double longitute, double latitude, int month, double[][] drywet, double[][] wetwet)
// Returns the longest number of consecutive mode (WET or DRY) days in forecast.
int numberOfWetDryDays (int[] forecast, int mode)
/*
* Analyzes the forecast array and returns the longest number of
* consecutive mode (which can be WET or DRY) days in forecast.
*/
int lengthOfLongestWetDrySpell (int[] forecast, int mode)
}
Use the main method as a driver to test your methods. To generate the weather for location at longitude -98.76 and latitude 26.70 for the month of February do:
java WeatherGenerator111 -98.76 26.70 3
public static void main (String[] args) {
int numberOfRows = 4001; // Total number of locations
int numberOfColumns = 14; // Total number of 14 columns in file
// File format: longitude, latitude, 12 months of transition probabilities
// Allocate and populate arrays that hold the transition probabilities
double[][] drywet = new double[numberOfRows][numberOfColumns];
double[][] wetwet = new double[numberOfRows][numberOfColumns];
populateTransitionProbabilitiesArrays(drywet, wetwet, numberOfRows);
/*** WRITE YOUR CODE BELLOW THIS LINE. DO NOT erase any of the lines above. ***/
// Read command line inputs
double longitute = Double.parseDouble(args[0]);
double latitude = Double.parseDouble(args[1]);
int month = Integer.parseInt(args[2]);
int[] forecast = oneMonthGenerator(longitute, latitude, month, drywet, wetwet);
int drySpell = lengthOfLongestSpell(forecast, DRY);
int wetSpell = lengthOfLongestSpell(forecast, WET);
StdOut.println("There are " + forecast.length + " days in the forecast for month " + month);
StdOut.println(drySpell + " days of dry spell.");
for ( int i = 0; i < forecast.length; i++ ) {
// This is the ternary operator. (conditional) ? executed if true : executed if false
String weather = (forecast[i] == WET) ? "Wet" : "Dry";
StdOut.println("Day " + (i+1) + " is forecasted to be " + weather);
}
}
Earn money selling
your Study Documents