Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This assignment will give you practice with functions and vectors. I have given you a starter file called hurricane.cpp . You are free to create

This assignment will give you practice with functions and vectors. I have given you a starter file called hurricane.cpp. You are free to create your solution from scratch. Create a program that will read data from a file called hurricanes.txt. The data will consist of a citys name, wind velocity and amount of rain for the hurricanes that occurred in the United States. The input process will be terminated by the EOF marker. Some cities will have a space in the name. (use the indata.ignore() statement where needed) Have the main function call a function to input the data from the file hurricanes.txt and store the data in 3 vectors, City, Wind, and Rain. The max number of elements is 50. However, the input function will keep track of the number of cities and put that count in the variable numcities. The Main Function should:1.Declare all vectors and variables needed2.Call the ReadData Function to read the data into the vectorsa.Pass the arguments neededb.Open the file hurricanes.txtc.Use a while loop to read data into the vectors until EOF is reachedd.close the file3.Call the SelSort Function to sort all three vectors by city.a.Use the selection sort to sort all three vectors simultaneously using numcities.4.Call the PrintVectors Function that prints the three vectors in tabular form with column headers 5.Call the ViolentWinds Function to print each city where the hurricane was violent. A Hurricane is violent if its windspeed is at least 120 mph. Display the citys name and windspeed with the header Violent Winds6.Call the MajorFlood Function to print each city where the hurricane produced a flood. A flood occurs if its rainfall is at least 3.5 inches. Display the citys name and rainfall windspeed with the header Major Floods7.Call the WindiestCity Function to return the vector position(hipos) of the city with the highest windspeed.8.Call the AverWind Function to return the average wind velocity.9.Call the AverRain Function to return the average rain fall.10.Display the name of the city with the highest winds speed along with its windspeed.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

Students also viewed these Databases questions

Question

1. Identify what positions are included in the plan.

Answered: 1 week ago