#include <iostream>
#include <string>
#include "Item.h"
using namespace std;
int main() {
double dTotalPrice = 0.0;
int iTotalWeight = 0;
Item itmMouse(24.99, 14, "Wireless Mouse");
Item itmKeyboard(22.49, 27, "USB Keyboard");
Item itmHDMI(24.99, 12, "HDMI Cable");
Item itmGlasses(7.99, 7, "Reading Glasses");
itmGlasses.setQuantity(2);
// Show the details of the order using printDetails()
cout << "Here are your shopping cart contents.\n";
itmMouse.show();
itmKeyboard.show();
itmHDMI.show();
itmGlasses.show();
// Compute the total price and total weight in this section
dTotalPrice += itmMouse.getOrderPrice();
dTotalPrice += itmKeyboard.getOrderPrice();
dTotalPrice += itmHDMI.getOrderPrice();
dTotalPrice += itmGlasses.getOrderPrice();
iTotalWeight += itmMouse.getOrderWeight();
iTotalWeight += itmKeyboard.getOrderWeight();
iTotalWeight += itmHDMI.getOrderWeight();
iTotalWeight += itmGlasses.getOrderWeight();
// Here we show the order details
cout << "The price of your order is $" << dTotalPrice << endl;
cout << "The shipping weight is " << iTotalWeight << " ounces\n";
cout << "That is " << iTotalWeight / 16.0 << " pounds\n";
return 0;
}
AND IF YOU NEED HERES THE Item.cpp FILE CODE:
#include <iostream>
#include <string>
#include "Item.h"
using namespace std;
PLEASE HELP ME IM TRYING TO LEARN, but the situation is that the main.cpp file code is all correct and given by my professor, i just have to make the classes and objects code work to allow the main.cpp file to run.
In the future, Please use code tags when you post. It makes the code easier for people to read. Code tags is on a little menu to the right side of your screen when you post. It's the button that looks like this <>. Just click on it and paste your code between the tags.