Include a Tornado class that stores the following information in private member variables: Name Data Type Description location string County of event category enum {TBD,F0,F1,F2,F3,F4,F5} Fujita Scale rating (NOAA) damage double Dollars of damage received Your class must have the following constructors and member functions: Default Constructor: The constructor should create an empty Tornado object, set the location to “”, the category to F0, and the damage to 0. 2nd Constructor: The second constructor should accept the Tornado’s location, category, and damage as arguments. Accessors: Appropriate accessor functions to return the values stored in an object’s member variables. Mutators: Appropriate mutator functions to set the values stored in an object’s member variables. Validate the data as is appropriate for the field To test your class, write a program (main) that creates an array of 5 Tornado objects. Initialize the array when you define it, using an initialization list and the data shown below. McCurtain, F2, 450000 Red River, F3, 1410750 Camp County, F2, 750250 Cass County, TBD, 295000 Display a menu that allows the user to: Print the information for all items in a table, using a word for the type. At the bottom of the table, print the total of the damage column. Edit a particular item (Print a numbered list of the array items, Read a number from the user, Allow the user to enter data for the item, Store the data into the array). Update the damage for all array items (display the name of each item and the current damage amount as you read the new damage amount)
Include a Tornado class that stores the following information in private member variables:
Name |
Data Type |
Description |
location |
string |
County of event |
category |
enum {TBD,F0,F1,F2,F3,F4,F5} |
Fujita Scale rating (NOAA) |
damage |
double |
Dollars of damage received |
Your class must have the following constructors and member functions:
- Default Constructor: The constructor should create an empty Tornado object, set the location to “”, the category to F0, and the damage to 0.
- 2nd Constructor: The second constructor should accept the Tornado’s location, category, and damage as arguments.
- Accessors: Appropriate accessor functions to return the values stored in an object’s member variables.
- Mutators: Appropriate mutator functions to set the values stored in an object’s member variables. Validate the data as is appropriate for the field
To test your class, write a
McCurtain, F2, 450000
Red River, F3, 1410750
Camp County, F2, 750250
Cass County, TBD, 295000
Display a menu that allows the user to:
- Print the information for all items in a table, using a word for the type. At the bottom of the table, print the total of the damage column.
- Edit a particular item (Print a numbered list of the array items, Read a number from the user, Allow the user to enter data for the item, Store the data into the array).
- Update the damage for all array items (display the name of each item and the current damage amount as you read the new damage amount)
Design your class and program by completing the CS 250 OOP Design Document. Give the description of the class along with a brief description of what is to be stored in each member variable and the purpose of each member function. Also give a description of what the main program will do. You’ll need to include time estimates for design, coding each function, program testing, and total time.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 8 images
I am so sorry. The