Question: Please help me to answer this code. http://nullptr.boisestate.edu/CS117/projects/project6/ the Existing code is belwo here: main.cpp #include #include Part.h using namespace std; //Do not modify this
Please help me to answer this code.
http://nullptr.boisestate.edu/CS117/projects/project6/
the Existing code is belwo here:
main.cpp
#include #include "Part.h" using namespace std;
//Do not modify this file int main(int argc, char **argv) { //Constructs a new part Part p("12-00001", "12-00001.dwg", 1); //Print the part out. cout << p.toString() << endl; //Test our set Drawing method p.setDrawing("14-11111.dwg"); cout << p.toString() << endl; //Test our set setId method p.setId("my_new_id"); cout << p.toString() << endl; //Test our set Quantity method p.setQuantity(42); cout << p.toString() << endl; //Test each of the accessor methods cout << p.getDrawing() << endl; cout << p.getId() << endl; cout << p.getQuantity() << endl; return 0; }
the second file is part.cpp
#include "Part.h" #include #include using namespace std; Part::Part(string id, string dwg, int qty) { identifier = id; CadFileName = dwg; quantity = qty; } string Part::getId() { return identifier; }; void Part::setId(string id) { identifier = id; }; string Part::getDrawing() { return CadFileName; }; void Part::setDrawing(string drawing) { CadFileName = drawing; }; int Part::getQuantity() { return quantity; }; void Part::setQuantity(int qty) { quantity = qty; }; string Part::toString() { std::ostringstream o; o << "Id: " << identifier << " drawing: "<< CadFileName << " qty: " << quantity; return o.str(); };
the third file is part.h
#include using namespace std; class Part { private: string identifier; string CadFileName; int quantity; public: Part(string id, string dwg, int qty); string getId(); void setId(string id); string getDrawing(); void setDrawing(string drawing); int getQuantity(); void setQuantity(int qty); string toString(); };
-----------------------------------------------------------
I got thoses exsiting code from last project 5 and it was part 1 and this project is project 6 for part 2
http://nullptr.boisestate.edu/CS117/projects/project5/ this is P5 if you just want to take a look at
http://nullptr.boisestate.edu/CS117/projects/project6/ this is P6 which is part 2 and I need help with thanks a lot.
(don't change the main.cpp, part.h and part.cpp) &( try to do it just on the new two files Assembly.h and Assembly.cpp)
-----------------------------------------------------------------------------------------------------------
this is someone try to do it but it didn't worked and he changed the exsiting file main.cpp , part.cpp and part.h
https://www.chegg.com/homework-help/questions-and-answers/please-help-answer-code-http-nullptrboisestateedu-cs117-projects-project6-existing-code-be-q20968589
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
