Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[C++] EconomicsAnalysis class The attributes of the class will be a GDP object and a UNEMP object. It should have a constructor that receives the

[C++]

EconomicsAnalysis class

The attributes of the class will be a GDP object and a UNEMP object.

It should have a constructor that receives the two file names, passing each to the read method of the GDP and UNEMP classes.

So if my two classes, GDP and UEMP, are already defined, how do I pass them in the constructor of EconomicAnalysis class and call them in main.cpp?

Header:

#ifndef ECONOMICSANALYSIS_H_INCLUDED #define ECONOMICSANALYSIS_H_INCLUDED #include "UNEMP.h" #include "GDP.h" #include #include #include #include

typedef struct fileData3{ GDP gdp; UNEMP unemployment; }structData2;

class EconomicsAnalysis{ public: EconomicsAnalysis(string filename, string filename2); };

#endif // ECONOMICSANALYSIS_H_INCLUDED

#include "EconomicsAnalysis.h" #include #include #include #include

EconomicsAnalysis::EconomicsAnalysis(string filename, string filename2){ int choice; cout << "Enter '1' to search years or '2' to view stored data. Press 0 to quit." << endl; cin >> choice; while(choice!=0){ if(choice == 1){ cout << "Economic Analysis:" << endl; GDP gdp; gdp.get(filename); UNEMP unemployment; unemployment.get(filename2); } else if(choice ==2){ cout << "Stored Data: " << endl; GDP gdp; UNEMP unemployment; gdp.show(); unemployment.show(); } else { choice; } } }

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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

5.3 Explain internal recruitment methods.

Answered: 1 week ago

Question

=+Are there shop stewards?

Answered: 1 week ago