Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
fossbeans: Main.cpp Project.h
g++ main.cpp -o fossbeans
fossbeans: main.o project.o
g++ main.o project.o -o fossbeans

Project.o: Project.cpp Project.h
g++ -c Project.cpp
main.o: main.cpp project.h
g++ -c main.cpp
project.o: project.cpp project.h
g++ -c project.cpp

clean:
rm -f Project.o fossbeans
rm -f project.o fossbeans
6 changes: 3 additions & 3 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#include <vector>
#include <string>

#include "Project.h"
#include "project.h"

using namespace std:
using namespace std;
int main() {

vector<Project *> projects;
Expand All @@ -29,7 +29,7 @@ int main() {
case 'N':
cout << "Enter name for the new project: " << endl;
cin >> eneteredProjectName;
projects.push_back(new Poject(eneteredProjectName));
projects.push_back(new Project(eneteredProjectName));
break;

case 'M':
Expand Down
5 changes: 3 additions & 2 deletions Project.cpp → project.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include "project.h"

Project::Project(std::string name) : _name(name), _submitted(0), _accepted(0)
{}

int Project::getRequests()
int Project::getRequests()
{
return _submitted;
}
Expand All @@ -28,4 +29,4 @@ void Project::acceptRequest()
return;
_submitted--;
_accepted++;
}
}
8 changes: 5 additions & 3 deletions project.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
/*
@file: project.h
@author:
Pinak Das
Tanay Khandke
*/
#ifndef PROJECT_H
#define PROJECT_H
#include <string.h>
#include <string>
class Project {
private:
int _submitted;
Expand All @@ -19,6 +19,8 @@ class Project {
int getSubmittedRequests();
int getAcceptedRequests();
std::string getName();
}
int getRequests();
void submitRequests();
};

#endif