Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

- A class Hurricane that holds information about a hurricane: year (int), name(string), category(int), wind (int) and landfall(string). - Two files are provided to you

- A class Hurricane that holds information about a hurricane: year (int), name(string), category(int), wind (int) and landfall(string).

- 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 Harvey that hit our region on August 17, 2017 and collect its relevant data items.

b.) Use these data to populate the default constructor

c.) Complete the code for the setters and getters of the class Hurricane.

d.) Define a function Print() that takes an object of class Hurricane and displays its data.

e.) Define a function strongerThan() that takes two objects of class Hurricane and returns the name of stronger one by comparing their categories.

2 ) Write the code of the main()

a.) Create 3 Hurricane objects corresponding to the hurricanes: Ike, Harvey and Katrina after researching their details.

b.) Print the details of each hurricane.

c.) Print the strongest hurricane out of the 3.

#pragma once

// File: Hurricane.h

// Programmer:

// Class:

// Description: This file defines the Hurricane Class.

#include

#include

using namespace std;

class Hurricane

{

private:

int formedIn;

std::string Hname;

int category;

int wind;

string landfall;

public:

Hurricane();

~Hurricane();

Hurricane(int bdate, std::string hname, int cat, int w, int p, std::string lf);

void setCategory(int c);

void setWind(int w);

void setLand(std::string lf);

int getCategory();

int getWind();

std::string getLandfall();

void print();

};

// File: Hurricane.cpp

// Programmer:

// Class:

// Description: This file implements the Hurricane Class.

#include

#include

using namespace std;

#include "Hurricane.h"

Hurricane::Hurricane(int year, std::string sname, int c, int w, int p, string lf)

{

formedIn = year;

Hname = sname;

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 c) {

category = c;

};

//In all following function members, complete by adding the relevant code

void Hurricane::setWind(int w) {

};

void Hurricane::setLand(std::string lf) {

};

std::string Hurricane::getLandfall() {

return landfall;

};

int Hurricane::getCategory() {};

int Hurricane::getWind() {};

int Hurricane::getPressure() {};

Hurricane::~Hurricane()

{

};

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

AutoCAD Database Connectivity

Authors: Scott McFarlane

1st Edition

0766816400, 978-0766816404

More Books

Students also viewed these Databases questions