Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

would it be multiple codes or just one code all in one? Programming Assignment 2: Classes Due September 23 A class Hurricane that holds information

image text in transcribed
would it be multiple codes or just one code all in one?
image text in transcribed
image text in transcribed
Programming Assignment 2: Classes Due September 23 A class Hurricane that holds information about a hurricane:year, name, category, pressure, wind and landfall. Two files are provided to you Hurricane.h and Hurricane.cpp Hurricane.h: defines the class Hurricane with its data and function members. Hurricane.cpp: implements some function members of the class Hurricane. Tasks to be performed: 1- Research the hurricane "Nicholas" that hit our region on September 14 and collect its relevant data items. 2 Use these data to populate the default constructor 3- Complete the code for the setters and getters of the class Hurricane. 4 Define a function Print() that takes an object of class Hurricane and displays its data. 5- Define a function strongerThan() that takes two objects of class Hurricane and returns the name of stronger one by comparing their categories. 6- Write the code of the main() Create 3 Hurricane objects corresponding to the hurricanes: Ike, Harvey and Katrina after researching their details. Print the details of each hurricane. Print the strongest hurricane out of the 3. a. b. C. 2/ File: Hurricane.cpp // Programmer: // Class: // Description: This file implements the Hurricane Cluss. #include #include using namespace std; #include "Hurricane.h" int w, int p, string 1f) Hurricane::Hurricane(int year, std::string sname, int , { formed In - year; Hname = name; category = c; wind = w; pressure = p; landfall - lf; Hurricane::Hurricane()//default constructor //Research the hurricane "Nicholas" and add the relevant information } void Hurricane::setCategory(int e) { category = 0; }; //In all following function members, complete by adding the relevant code void Hurricane::setwind(int w) { }; void Hurricane::set Pressure(int p) { }; void Hurricane::setland (std::string 1f) { }; std::string Hurricane::getLandfali() { return landfall; int Hurricane::getCategory() (); int Hurricane::getwind) 0); int Hurricane::getPressure() (); Hurricane::Hurricane() }; #pragma once // File: Hurricane.h // Programmer: 1/ Class: // Description: This file defines the Hurricane Class. #include #include using namespace std; define knotsToMPH 1.15 class Hurricane { private: int formed in; std::string Hname; int category; int wind; int pressure; string landfall; public: Hurricane(); Hurricane(); Hurricane(int bdate, std::string hname, int cat, int w, int p, std::string 1f); void setCategory(int c); void setWind(int w); void set Pressure(int p); void setLand(std::string 1f); int getCategory(); int getwind(); Ant getPressure(); std::string getLandfall(); void print(); }

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

Students also viewed these Accounting questions

Question

To solve p + 3q = 5z + tan( y - 3x)

Answered: 1 week ago