Question: Need Help with compiling c++ program i followed instruction but i couldnt figure out compiling thse 3 codes as g++ Struct.cpp->>>>> #include using namespace std;

Need Help with compiling c++ program i followed instruction but i couldnt figure out compiling thse 3 codes as g++

Need Help with compiling c++ program i followed instruction but i couldnt

figure out compiling thse 3 codes as g++ Struct.cpp->>>>> #include using namespace

std; struct Furniture{ int identifier; string description; float value; }; struct Building{

Struct.cpp->>>>>

#include

using namespace std;

struct Furniture{ int identifier; string description; float value; }; struct Building{ string identifier; string description; double value; }; struct Computer{ long int identifier; string description; float value; };

Template class code->>>>> template class GenericRecord{ T structure; public: void setStructure(T i){ structure.identifier = i.identifier; structure.description = i.description; structure.value = i.value; } T getStructure(){ return structure; }

main file code ->>>> int main(){ GenericRecord furniture[3]; GenericRecord computer[3]; GenericRecord building[3]; Furniture f; Computer c; Building b; cout>f.identifier; cout>f.description; cout>f.value; furniture[i].setStructure(f); } cout>c.identifier; cout>c.description; cout>c.value; computer[i].setStructure(c); } cout>b.identifier; cout>b.description; cout>b.value; building[i].setStructure(b); } cout The goal of this project is to enable students to practice programming templates. You will writea template C++ class called "GenericRecord" and a main) function that uses the class. The project details are provided below 1. INTRODUCTION You just noticed that you write many programs that process data records that have the following attributes: Identifier Description Value You decide that you will write a template class called GenericRecord to be used to instantiate objects of this format 2. DATA STRUCTURES 2.1 Template class The template class will take one parameter as follows: template class GenericRecord The class should have a data member in the private section of the class whose type is the template parameter

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!