class diagram is correct or not...If the class diagram is correct please give the short explanation for each box. And if the class diagram is not correct then please make the correct class diagram and give the explanation for each box as well..

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Based on that code can u please check the given class diagram is correct or not...If the class diagram is correct please give the short explanation for each box. And if the class diagram is not correct then please make the correct class diagram and give the explanation for each box as well...

 

code:

#include <iostream>

#include <string>

using namespace std;

 

class Product{

  public:

    string name;

    double price;

    Product(string m_name, double m_price)

    {

      name = m_name;

      price = m_price;

    }

};

 

void printLine()

{

  for(int i = 0; i<60; i++)

    cout << "_";

  cout << endl << endl;

}

 

int main()

{

  Product *arr[4];

  arr[0] = new Product("A", 10);

  arr[1] = new Product("B", 20);

  arr[2] = new Product("C", 30);

  arr[3] = new Product("D", 40);

  int uid;

  string name, address, state;

  int pno, poscode;

  double shipping;

  cout << "\t\t\tWELCOME" << endl;

  printLine();

  cout << "\t\tEnter User Id: ";

  cin >> uid;

   

  char ch = 'Y';

  do

  {

    system("clear");

    cout << "\t\t\tCUSTOMER DETAIL" << endl;

    printLine();

    cout << "\tNAME | ";

    cin.ignore();

    getline(cin, name);

    cout << "\tPHONE NUMBER | ";

    cin >> pno;

    cout << "\tADDRESS | ";

    cin.ignore();

    getline(cin, address);

    cout << "\tPOSCODE | ";

    cin >> poscode;

    cout << "\tSTATE | ";

    cin.ignore();

    getline(cin, state);

    cout << "\tSHIPPING COST | ";

    cin >> shipping;

    cout << endl << endl;

    cout << "\tProceed to Product Detail?" << endl << "\t(Y) YES" << endl << "\t(N) RESET" << endl;

    cout << "\tChoice | ";

    cin >> ch;

  }while(ch != 'Y');

  system("clear");

  ch = 'Y';

  int count = 0;

  char products[100];

  int quantity[100];

  int discount;

  do

  {

    system("clear");

    cout << "\t\t\tPRODUCT DETAIL" << endl;

    printLine();

    for(int i = 0; i < 4; i++)

    {

      cout << "\t" << '(' << (char)('A' + i) << ") |PRODUCT " << arr[i]->name

        << " ------ RM " << arr[i]->price << " |" << endl;

    }

    cout << endl << endl << "\t|DISCOUNT CODE:" << endl;

    cout << "\t[disc50\%]" << endl << "\t[disc25\%]" << endl;

    char choice = '0';

    count = 0;

    do

    {

      cout << endl << " INSERT PRODUCT ";

      if(choice != '0')

      {

        cout << "(IF NO PRESS \'0\') ";

      }

      cout << "| ";

      cin >> choice;

      if(choice == '0')

        break;

      cout << " INSERT QUANTITY | ";

      cin >> quantity[count];

      products[count] = choice;

      count++;

    } while(choice != '0');

    cout << endl << " DISCOUNT CODE | ";

    cin >> discount;

    cout << endl;

    cout << " Proceed to Billing?" << endl << " (Y) YES" << endl << " (N) RESET" << endl;

    cout << " Choice | ";

    cin >> ch;

  }while(ch != 'Y');

  system("clear");

  cout << "\t\t\tRECEIPT" << endl;

  printLine();

   

  cout << " " << name << "\n " << pno << "\n "

    << address << "\n " << poscode << "\n "

    << state << endl << endl;

   

  double total = 0;

  for(int i = 0; i < count; i++)

  {

    cout << " Product " << products[i] << " Qty-" << quantity[i] << endl;

    total = total + (arr[products[i] - 'A']->price * quantity[i]);

  }

  cout << " Amount  - RM" << total << endl;

  cout << " Discount " << discount << "\%" << endl;

  cout << " Shipping - RM" << shipping << endl;

  total = (total * discount) / 100.0 + shipping;

  cout << " Total  - RM" << total << endl << endl;

  cout << " PIC - " << uid << endl << endl;

  cout << "\t\tTHANK YOU FOR SHOPPING WITH US !" << endl;

  return 0;

}

Customer
Orders
OrderDetails
- orderlD: int
- productID: int
- productName: string
- quantity: int
- cost: float
- subtotal: float
- orderlD: int
- customeriD: int
- customerName: string
- customerAddress: string
|- customerPhone: string
|- customerEmail: string
- orderDate: string
0.
- customerID: int
- orderStatus: string
+ registerCustomer(0
+ updateCustomerDetails()
+ login()
+ placeOrder()
0.
ShoppingCart
User
Products
|- shoppingcartID: int
- productiD: int
|- quantity: int
|- userlD: string
- userPassword: string
productID: int
- productName: string
- productType: string
- productSize: int
|- productWorkmanship: string
- loginStatus: string
+ addProduct()
+ updateShoppingcart()
+ checkOut()
+ filterProducts
-searchProducts
Payment
paymentID: int
paymentMethod: string
|
Transcribed Image Text:Customer Orders OrderDetails - orderlD: int - productID: int - productName: string - quantity: int - cost: float - subtotal: float - orderlD: int - customeriD: int - customerName: string - customerAddress: string |- customerPhone: string |- customerEmail: string - orderDate: string 0. - customerID: int - orderStatus: string + registerCustomer(0 + updateCustomerDetails() + login() + placeOrder() 0. ShoppingCart User Products |- shoppingcartID: int - productiD: int |- quantity: int |- userlD: string - userPassword: string productID: int - productName: string - productType: string - productSize: int |- productWorkmanship: string - loginStatus: string + addProduct() + updateShoppingcart() + checkOut() + filterProducts -searchProducts Payment paymentID: int paymentMethod: string |
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education