EE308_Lab9

厦大打工人 2021-11-16 23:22:03
Link of this classhttps://bbs.csdn.net/forums/MUEE308FZ?typeId=17613
Requirement of this assignmenthttps://bbs.csdn.net/topics/603386400
NameYUAN XIA
MU ID_FZU ID19105185_831901317

 

目录

Question


Question

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:

  1. sequence diagram:

 

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();
};

 

...全文
188 回复 打赏 收藏 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

183

社区成员

发帖
与我相关
我的任务
社区描述
福州大学 梅努斯国际工程学院 软件工程 教学
软件工程 高校
社区管理员
  • 单步调试
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧