lab (part 1) (100%) MemberParliament Module Design and code a class named MemberParliament that holds information about

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

lab (part 1) (100%) MemberParliament Module Design and code a class named MemberParliament that holds information about

Post by answerhappygod »

lab (part 1) (100%)
MemberParliament Module
Design and code a class named MemberParliament thatholds information about a member of parliament. Place your classdefinition in a header file named MemberParliament.h andyour function definitions in an implementation filenamed MemberParliament.cpp.
Include in your solution all of the statements necessary foryour code to compile under a standard C++ compiler and withinthe sdds namespace.
MemberParliament Class
Design and code a class named MemberParliament thatholds information about a member of parliament.
MemberParliament Private Members
The class should be able to store the following data (Useappropriate names!):
You can add any other private members to the class, as requiredby your design.
MemberParliament Public Members
A custom constructor that receives as parameters the MP Id andage. Set the district the MP represents as Unassigned. Assumeall data is valid.
void NewDistrict(const char* district): assigns the MP to newdistrict. Prints to the screen the message
where
ostream& write(ostream& os): a query that insertsinto os the content of the object in the format
istream& read(istream& in): a mutator that reads fromthe stream in the data for the current object
Helper Functions
Minister Module
Design and code a class named Minister that holdsinformation about a minister of the crown in the Canadian Cabinet.Place your class definition in a header filenamed Minister.h and your function definitions in animplementation file named Minister.cpp.
Include in your solution all of the statements necessary foryour code to compile under a standard C++ compiler and withinthe sdds namespace.
Minister Class
Design and code a class named Minister that holdsinformation about the a minister of the crown in the CanadianCabinet. This class should inheritfrom MemberParliament class.
Minister Private Members
The class should be able to store the following data (on top ofdata coming from the parent class):
You can add any other private members in the class, as requiredby your design. Do not duplicate members from the baseclass!
Minister Public Members
a custom constructor that receives the following informationabout the Minister: idd, age, the year assumed office, district,and name of the prime minister. Call the constructor from the baseclass and pass the relevant data to it. update the private datamembers of the Minister accordingly
void changePM(const char* pm): a mutator that updates the PM theminister reports to.
void assumeOffice(double year): a mutator that updates the yearthe minister assumed office
ostream& write(ostream& os): a query that insertsinto os the content of the object in the format
istream& read(istream& in): a mutator that reads fromthe stream in the data for the current object
Helper Functions
w7_main Module (supplied)
Do not modify this module! Look at thecode and make sure you understand it.
Sample Output
Files to submit:
Custom code submission
If you have any additional custom code, (i.e. functions, classesetc) that you want to reuse in this workshop save them under amodule called Utils (Utils.cpp and Utils.h) and submit them withyour workshop using the instructions in the "Submitting UtilsModule" section.
Data Entry
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply