How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask ATLPROG Your Own Question
ATLPROG, Computer Software Engineer
Category: Programming
Satisfied Customers: 7677
Experience:  MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
Type Your Programming Question Here...
ATLPROG is online now
A new question is answered every 9 seconds

I need help with this program I do have the president.h fileYour

Customer Question

I need help with this program I do have the president.h file
Your company has been asked to develop a program for the Brain Readiness Academic Training Institute (BRATI) that will help their BRATI elementary students learn the order of United States Presidents as well as some information about them. Write a C++ console application that performs the tasks as spelled out below:
In this project, you will implement a bag class that will store a vector of presidents. The Program will display a preseident name and then ask You what the presidential number is. For example, "What is the presidential number of Barack Obama?". Your reply should be 44. At that point in time the program will display:
Time he lived
date he took office
date he left office
his party
previous office held
the name of his vice president
If you type an incorrect value for the presidential number, the program will display an error message and the correct presidential number, incorrect responses and total guesses.
The User will click -1 to exit the program if they do not want to continue guessing presidential numbers.
You will need to create a first screen that gives users/players directions. Here is one possibility:
** Presidnets' Game **
** **
** Guess the number of each President **
** or key in -1 for guess to exit **
** **
** by ***** ***** **
I attached a possible president.h file (above), you may modify things, but in general, you will probably need everything in there. Note the overloaded functions (methods in OOP terminology) at the bottom of the header file. Take a look at how the baccount.cpp file implemented these methods, you will be doing something similar. There is also something new. friends functions. In general a friend function is not part of the class but has access to classes private data. Like the neighbor that feels free to walk into your house and get a beer out of the refrigerator without asking. ;) See pages 680 to 684 for more detail.
You will need to create 2 files (one is the main the other is the president.cpp) and use the final bag class from previous assignments:
a main program that
typedef Presidents BAG_ELEMENT_TYPE;
a president class based on the .h file given or something similar (data files located in FAQ number 2 below)
Use the bag class, note in number one the BAG_ELEMENT_TYPE for this program will be a President object
The main program main function should be an infinite loop that puts out instructions and sets the game in motion. Here are some possible functions you can use to help break things apart:
void instructions();
void totals(int& correctRef, int &wrongRef);
void loadPresidents(bag& bagOfPresidents);
int getGuess(Presidents& pres);
void getTerm(int rand);
// this is a little extra, one president ran in two different nonconsecutive terms,
// see if you can figure out how to identify his terms
void playPresidents();
Again, these are just suggestions, this is your program, so you can break it apart however you want.
This project is worth 6
Submitted: 2 years ago.
Category: Programming
Expert:  Ratheesh Ravi replied 2 years ago.
Hi,Thank you for using Just Answer.I can help you with the CPP code for this challenge. Could you please tell me the deadline for receiving the solution.RegardsRatheesh
Customer: replied 2 years ago.
This is my president.h file#ifndef PRESIDENTS_H // Avoid redeclaring class Presidents.
#define PRESIDENTS_H // This code is compiled only once
#include // for class stringusing namespace std; // avoid having to write std:: as in std::stringclass Presidents
public: // class member functions//--constructors
Presidents(string presidentNumber, string presidentName, string birthDeathDates,
string dateTookOffice, string dateLeftOffice,
string party, string previosOffice, string vicePresident);//--accessorsstring getPresidentNumber() const;
// post: return the President's number
string getPresidentName() const;
// post: return the President's name
string getDateBornDied() const;
// post: return the President's birth and/or death dates
string getDateTookOffice() const;
// post: return the President's date s/he took office
string getDateLeftOffice() const;
// post: return the President's date s/he left officestring getParty() const;
// post: return the President's party(s)string getPreviousOffice() const;
// post: return the President's previous office heldstring getVicePresident() const;
// post: return the President's Vice President(s)string toString() const;//--modifiers - not required at this timeprivate:
string presidentNumber;
string presidentName;
string birthDeathDates;
string dateTookOffice;
string dateLeftOffice;
string party;
string previousOffice;
string vicePresident;};//--Auxilliary functions// With these functions, Presidents objects can be
// sorted and searched by the standard algorithms
// currently we only use the overloaded == operater
bool operator < (const Presidents & left, const Presidents & right);
bool operator == (const Presidents & left, const Presidents & right);
bool operator != (const Presidents & left, const Presidents & right);
bool operator <= (const Presidents & left, const Presidents & right);
bool operator > (const Presidents & left, const Presidents & right);
bool operator >= (const Presidents & left, const Presidents & right);#endif // ifndef PRESIDENTS_HI need the cpp inplementation as well as the mainI have the data files as well as an example how the program shut run but I can't attach here
Customer: replied 2 years ago.
I need it tomorrow night
Customer: replied 2 years ago.
Would you be able to do it?
Customer: replied 2 years ago.
Hello are u still there
Expert:  Ratheesh Ravi replied 2 years ago.
Sorry, tomorrow is too tight for me.
I will opt out of the question so that other experts will help in this.
Customer: replied 2 years ago.
ok so is someone else who can help

Related Programming Questions