Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#ifndef _PRODUCT_H #define _PRODUCT_H #include using namespace std; class Product { private: int plu; string productName; int type; double price; double inventory; public: Product(int pl,

#ifndef _PRODUCT_H

#define _PRODUCT_H

#include using namespace std;

class Product { private: int plu; string productName; int type; double price; double inventory;

public: Product(int pl, string pn, int t, double pr, double i); Product();

int getPLU(); string getProductName(); int getType(); double getPrice(); double getInventory(); double updateInventory(double quantity); };

#endif

header file

product.cpp

#include "product.h" using namespace std; Product::Product() { plu = 0; productName = "none yet"; type = 0; price = 0; inventory = 0; } Product::Product(int pl, string pn, int t, double pr, double i) { plu = pl; productName = pn; type = t; price = pr; inventory = i; } int Product::getPLU() { return plu;} string Product::getProductName() { return productName;} int Product::getType() { return type;} double Product::getPrice() { return price;} double Product::getInventory() { return inventory;} double Product::updateInventory(double quantity) { if (quantity > inventory) cout << "This item is not in stock." << endl; else inventory -= quantity; return inventory; }

it is giving me these errors 1>------ Build started: Project: ConsoleApplication23, Configuration: Debug Win32 ------ 1> product.cpp 1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup 1>c:\users\sunena\documents\visual studio 2012\Projects\ConsoleApplication23\Debug\ConsoleApplication23.exe : fatal error LNK1120: 1 unresolved externals ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =========

how do i fix it? i am using visual studio 2012 ultimate and this is c++ programming

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

Briefly describe the transformation process.

Answered: 1 week ago