183
社区成员
发帖
与我相关
我的任务
分享| Link of this class | https://bbs.csdn.net/forums/MUEE308FZ?typeId=17613 |
|---|---|
| Requirement of this assignment | https://bbs.csdn.net/topics/603386400 |
| Name | YUAN XIA |
| MU ID_FZU ID | 19105185_831901317 |
目录
Live-streaming sale, through some Internet platforms, is a new way of service using live-streaming technology for close commodity display, consultation response, and shopping guide. Merchants can open their own live broadcast room, or employ professional anchors to recommend goods. At present, not only many celebrities flock into this field, but some big companies’ executives are also frequently involved. Please try to design a comprehensive live-streaming sale system.
|
(i) List some actors that interact with this system. Explain the relevance of each actor. |
|
Your Answer:
Actor: 1.customer. People who join the live broadcast platform to buy goods or return goods. 2.merchant. People who launch live broadcast platform to sell and manage goods.
|
|
(ii) Prepare a use case diagram for this system. |
|
Your Answer:
|
|
(iii) Prepare a normal scenario for each use case. (i.e. describe each use case in words) |
|
Your Answer:
1.After joining the live studio, customers can see the product details and then choose whether to buy the product.
2.The merchant launched a live broadcast to sell the goods.
3. Merchants manage commodities, including the addition, deletion, modification and inspection of commodities
|
|
(iv) Prepare sequence diagrams or activity diagrams for primary scenarios. By the way, each scenario can be described by a sequence diagram or an activity diagram, but both diagrams must be used in the question. |
|
Your Answer:
activity diagram:
2. sequence diagram:
activity diagram:
3. sequence diagram:
activity diagram:
|
|
(v) Prepare a class diagram for this system. Explain which principles of object-oriented are applied in your design. |
|
Your Answer:
Composite/Aggregate Reuse Principle CARP
|
|
(vi) Prepare state diagrams for primary classes. |
|
Your Answer:
|
|
(vii) Write the skeleton code corresponding to the class diagram in C++, Java, Python, or C#. |
|
#include <iostream>
using namespace std;
class customer{
private:
string name;
string userID;
};
class merchant{
string name;
};
class BroadcastRoom:public merchant{
private:
string roomID;
string userID;
string roomName;
bool enter;
public:
void initiateRoom(string roomID, string roomName, string userID);
void joinRoom(string roomID, string userID,string roomName, bool enter);
};
class commodity: public merchant{
private:
string commodityName;
string link;
double price;
int number;
string orderNum;
string userName;
public:
void addCommodity(string commodityName, string link, string orderNum, int number);
void minusCommodity(string commodityName, string link, string orderNum, int number);
void inspection(string commodityName, string link, string orderNum, double price);
void changePrice(string commodityName, string link, string orderNum, int number, double price);
};
class order : public customer{
private:
string orderNum;
string address;
string userName;
double price;
public:
void returnBack(string orderNum, string address, string userName, double price);
};
class shoppingCart : public customer{
private:
string link;
double price;
string address;
string userName;
public:
void purchase();
void addCommodity();
void minusCommodity();
};
|