Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Congratulations! After a months' long, rigorous, and very competitive screening process, Amazon,com has selected you as a new Engineer in their Prime Divison to help update their Customer Order...

1 answer below »
Congratulations!  After a months' long, rigorous, and very competitive screening process,  Amazon,com has selected you as a new Engineer in their Prime Divison to help update their Customer Order History and Invoice tracking system (COHI).  Your job is to come up with a clean object-oriented design using reusable C++ classes for printing order detail reports and customer invoices.  Here are real examples of each.  (As it turns out, Amazon is using a recent summer reading book order for my kids, for your training support): 
Sample Actual Amazon Order-Detail History
AmazonOrderDetails.docx
Sample Actual Amazon Invoice
AmazonInvoice-1.docx
Actions
Your new Amazon supervisor wants you to prototype an a
eviated, but realistic object-oriented design to support a list of products, orders, order details, shipping records, invoices, and customers.   Your system should contain at least one customer, one order,  five products, five order details, one shipping record, and one payment transaction in order to print an order details list and invoice as shown above.  The product names need not be the same as above.   
Below is a class diagram that models the class attributes that will allow you to support this system.  
Sales Order System-1.pdf
You should create classes to implement this design.   
Guidelines:  
· Use Data Encapsulation.   All class attributes should be accessed through either constructors or getters and setters.  Most attributes should be set using constructors.  All attributes that need to read from your class objects should be accessed with getters. CLion supports code generation for this purpose.  After you implement classes with the class attributes defined,  press Alt-Insert in your class file, and CLION will present you an option dialog to generate getters and setters for your classes.  I suggest generating only getters.  
· Your implementation has no need for,  and should not include any global variables, with the possible exception of constants. 
· Your system,  as in real-life,  will generate an order, and only later ship the order, and generate a payment.  See the sample main method provided below for the order of operations.     
· Your Order Details print-out should obtain its data only through the object model.  No hard-coding is permitted in the print-outs.  
· Note that Order and OrderDetails are separate objects but an order contains a list of OrderDetails.  Lab 2 shows you how to create A
ayLists of Java Objects.   
Simplifications:   
·  For simplicity, you can assume that all order items are shipped together in one shipment and paid for in one transaction, though in real-life this is not the case. 
· Similarly,  orders are paid for in a single transaction, while in real-life Amazon permits multiple payments and shipments per order. 
· Again,  since we assume only one payment per order,  we will generate only one invoice per order.
· Finally,  your system will not need to contain many millions of products, rather only five.  Lucky you. 
Class Diagram Model  for System (Critical!)
Sales Order System-1.pdf
Amazon Order History and Invoicing System Hints:
Amazon Order History and Invoicing System Hints.docx
Actions
Sample Simplified Order Details Output: 
*************
Order Details
*************
Ordered on May 21, 2020 Order # XXXXXXXXXX
Shipping Address
Michael Whitehead
1298 Hares Hill Road
Kimberton, PA 19442
United States
Payment Method
Amazon.com Visa
**** 7744
Order Summary
Item(s) Subtotal:
$34.85
Shipping and Handling
$7.25
Total before tax:
$42.10
Estimated tax to be collected:
$2.53
Grand Total:
$44.63
Delivered May 22, 2020
The Pirate's Coin: A Sixty-Eight Rooms Adventure (The Sixty-Eight Rooms Adventures), Malone, Marianne
Sold by: Amazon.com Services LLC
Sold by: 7.99
Condition: New
Pax, Pennypacker, Sara
Sold by: Amazon.com Services LLC
Sold by: 5.89
Condition: New
The River (A Hatchet Adventure) Paulsen, Gary
Sold by: Amazon.com Services LLC
Sold by: 8.49
Condition: New
Brian's Return (A Hatchet Adventure)
Sold by: Amazon.com Services LLC
Sold by: 7.19
Condition: New
A Long Walk to Water: Based on a True Story, Park, Linda Sue
Sold by: Amazon.com Services LLC
Sold by: 5.29
Condition: New
Sample Simplified Invoice Output:
***********************************************************
Final Details for Order # XXXXXXXXXX
***********************************************************
Order Placed: May 21, 2020
Amazon.com order number: XXXXXXXXXX
Order Total: $34.85
Shipped on May 22, 2020
Items Ordered/Price
The Pirate's Coin: A Sixty-Eight Rooms Adventure (The Sixty-Eight Rooms Adventures), Malone, Marianne
Sold by: Amazon.com Services LLC
Sold by: 7.99
Condition: New
Pax, Pennypacker, Sara
Sold by: Amazon.com Services LLC
Sold by: 5.89
Condition: New
The River (A Hatchet Adventure) Paulsen, Gary
Sold by: Amazon.com Services LLC
Sold by: 8.49
Condition: New
Brian's Return (A Hatchet Adventure)
Sold by: Amazon.com Services LLC
Sold by: 7.19
Condition: New
A Long Walk to Water: Based on a True Story, Park, Linda Sue
Sold by: Amazon.com Services LLC
Sold by: 5.29
Condition: New
Shipping Address
Michael Whitehead
1298 Hares Hill Road
Kimberton, PA 19442
United States
Shipping Speed:
OneDay
Payment Method:
Signature | **** 7744
Rewards Points
Item(s) Subtotal: $34.85
Shipping and Handling: $7.25
Total before tax: $42.10
Estimated tax to be collected: $2.53
Grand Total: $44.63
Billing Address
Michael Whitehead
1298 Hares Hill Road
Kimberton, PA 19442
United States
Credit Card Transactions:
Amazon.com Visa ending in **** 7744: May 22, 2020 : $44.63
Miscellaneous Formatting Tricks you will Need:  
#include #include #include using namespace std;
enum ShipmentStatus {InProcess, Shipped, Delivered} ;
int main() {
double price = 99.99;
string creditCardNumber = " XXXXXXXXXX";
string shortcc = creditCardNumber.substr(creditCardNumber.length()-4);
cout
"****" + shortcc
"\n";
printf("$%.2f\n", price);
const char* shipmentStatusNames[] = {"InProcess", "Shipped", "Delivered"};
cout
shipmentStatusNames[InProcess]
endl;
tm t = {};
istringstream ss("10/25/2020 12:35");
ss
get_time(&t, "%m/%d/%Y %H:%M");

Test if string is converted to date
if (ss.fail()) {
XXXXXXXXXXcout
"Parse failed\n";
} else {
XXXXXXXXXXcout
put_time(&t, "%c")
"\n";
XXXXXXXXXXcout
put_time(&t, "%b %d, %Y")
"\n";
}
}
Output:
****7744
$99.99
InProcess
10/25/20 12:35:00
Oct 25, 2020

Amazon Order History and Invoicing System Hints
Class File Structure:
1. C++ does allow multiple classes per file and it might be easier to include all your classes in a single file. For larger projects, in industry, classes would be separated, but let’s keep it simple for our purposes.
You can add your enums and any global variables at the top, followed by class definitions, then your main driver method. Notice that class definitions are followed by a semicolon, but the main method is not.
Example:
enum Condition {
New, Used, Reconditioned
};
enum ShipmentStatus {
InProcess, Shipped, Delivered
};
enum ShipmentSpeed {
OneDay, TwoDay, Mail
};
enum PaymentType {
CreditCard, BankTransfe
};
class Customer {
private:
string customerId;
string customerName;
string streetAddress;
string cityStateZip;
string country;
public:
Customer(string customerId, string customerName, string streetAddress, string cityStateZip, string country) {
XXXXXXXXXXthis->customerId = customerId;
XXXXXXXXXXthis->customerName = customerName;
XXXXXXXXXXthis->streetAddress = streetAddress;
XXXXXXXXXXthis->cityStateZip = cityStateZip;
XXXXXXXXXXthis->country = country;
}
Customer() {}
string getCustomerName() {
XXXXXXXXXXreturn customerName;
}
string getStreetAddress() {
XXXXXXXXXXreturn streetAddress;
}
string getCityStateZip() {
XXXXXXXXXXreturn cityStateZip;
}
string getCountry() {
XXXXXXXXXXreturn country;
}
};
int main() {
vecto
Product> products;
OrderDetailsTester odt;
products = odt.addProducts(products);
vecto
OrderItem> orderItems;
orderItems = odt.createOrderItems(products);
Customer customer = Customer("221", "Michael Whitehead", "1298 Hares Hill Road", "Kimberton, PA 19442",
"United States");
Order order = odt.createOrder(orderItems, customer);
odt.createShipment(order);
odt.createPayment(order);
odt.printOrderDetails(order);
odt.printInvoice(order);
return 0;
}
Using Enum Values:
The are many cases when you want to convert an enum value to a string for printing. Enum values in C++ are numbers and by default start at zero and increment.
That’s convenient since you can an a
ay of strings to match your desired enum descriptions.
Representing enum values as strings:
enum Condition {
New, Used, Reconditioned
};

Use for string representation of enum values
string Conditions[] =
{
"New",
"Used",
"Reconditioned"
};
Convert enum value to a string
cout
Conditions[product.condition::Used]
endl;
Another example:
string getShipmentStatusAndDate() {
return ShipmentStatuses[shipment.getShipmentStatus()] + " " + getFormattedDate(shipment.getShippedDate());
}
Methods for Formatting Dates and Times:
There are many ways to format Dates and Times in C++. There are newer li
aries to do these tasks in an easier more Java-like way, but for simplicity here is a way to it using the standard li
ary. Put these functions in your Order to simplify printing out dates and times:
#include #include #include #include Add a dollar sign and limit to two decimals
A more robust method would support multiple cu
encies
and decimal representations
string getCu
encyFormat(double amount) {
char buffer[50];
sprintf(buffer, "$%.2f", amount);
string
Answered Same Day Nov 09, 2021

Solution

Ria answered on Nov 25 2021
144 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here