VS 2010 C++ weather and national emergency messages - 46123

Solution Posted by


Rating : (19)A+
Solution Detail
Price: $20.00
Request Description


This program will provide an opportunity to practice using multiple C++ classes and class composition.


Write a program that will interpret weather and national emergency messages disseminated by the U.S. Government.

The government has created a dataset of "FIPS codes." Each county in the U.S. is assigned a unique five-digit code. This code is used to identify the county when warnings are generated. It is most used for weather warnings, but also could be used for industrial or national emergencies. For example, for Saginaw County, MI, the code is 26145.

You are provided with a data file containing all FIPS codes for each county in the nation (filename usfips.txt). An example line of data in the file would be:


You are also provided with a file that contains a list of active warnings nationwide (filename alerts.txt). A typical warning message in this file would look like the following example:

2009-09-13T20:16,2009-09-13T21:15,26-145,SEVERE THUNDERSTORM WARNING

Output for this warning message should be something like:


Effective: 13 SEP 09 at 8:16 p.m. until 13 SEP 09 at 9:15 p.m

Write your program such that it processes through all active warnings, decodes the data, and writes a warning message similar to the provided example for each alert.

Design your solution using an object-oriented approach. Create a class that will store and manage information for one county. This should include data members for FIPS code, county name, and state code. Include get/set functions for all data members as well as at least one constructor. Next, design a "manager" class that will include and manage a list of FIP code objects. This manager class will act as a "database" of FIP codes. Be sure it includes a function to return the county and state name given a valid FIP code.

Your program should be driven by a list of warning messages(found in file alerts.txt). Each line of data in this file represents a distinct warning message that is disseminated by an agency of the U.S. Government. So finally, create a class that will store one alert message. This will store relevant information about the alert including the FIPS code. Note that objects of the class must have access to a FIPS manager object in order to retrieve the county name before the output is displayed.



Data Members

Member Functions


Store info on one county

FIPS code, county name, state code

Default constructor, set/get functions

County List

Store and retrieve a county/state given a FIPS code

Array of County objects

Constructor should build array of County objects from file usfips.txt, function to search for and retrieve a county information object given a FIPS code.


Store info on one warning/alert

FIPS code for county, warning start time, warning end time, type of warning

Functions to decode a coded alert message and produce the warning message in readable format.

Consider use of a provided string tokenizer class to aid in decoding comma-delimited files. These class files are:

  • StringTokenizer.h
  • StringTokenizer.cpp

You can also integrate stringstream objects for input operations.

A sequence of actions in your driver could be:

  1. Read an alert/warning record.
  2. Utilize a County List object to access a County object given a FIPS number.
  3. Store county name/state code information in the county object.
  4. Direct order alert/warning object to write a line to the output.
  5. Get next alert/warning message until end-of-file.

Your output should be a summary report including all warning messages in the provided input file.

Design your application using guidelines to maximize modularity, reusability, and maintainability.



Deliver the following as your final product:

  • Printed cover page with assignment name and your name
  • All final source code files (.cpp and/or .h files)
  • Printed Output processing all inputs in the provided data file



Solution Description

VS 2010 C