EE308 Lab 9

sunshine1211111 2021-11-16 22:37:07

LAB 9 Object-oriented Modeling and Design with UML

 

Name:

Zejing.fang

MU ID:

19105274

FZU ID:

831901203

 

 

(i) List some actors that interact with this system. Explain the relevance of each actor.

Your Answer:

 

Actor:Professional anchors,such as many celebrities and some big companies’ executives ,who need to supervise the content of merchants' live broadcast to comply with regulations, and also supervise the legality of merchants' goods sold

Actor:Merchants,who apply for livestreaming permission from the administrator and sell items to customers on the livestreaming platform

Actor:Customers,who are watching the live broadcast and buying the goods through the Live-streaming sale system.

 

 

 

 

 

 

 

 

 

 

(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:

Register: anchors and customers need to register their accounts before

using this system.

Login: anchors and customer Login, including account and password;

Exit: all of them can exit;

Watch the live broadcast: Customers watch live broadcast, including live broadcast links and product links;

Browse Products: Customers know some significant information, including prices, live links,expression,quality and so on;

Consult Customer Service: Ask for store information;

Purchase somthing: The decision of something to buy, including customer balance, product information;

Open a living: Enables live streaming, including examing the quality of living shows;

Show products: show the information of products , including price and so on;

Shopping guide: provide customer with some assists about products ;

Review the product: check the products , including price ,quality,expression, details about payment an so on;

Review speech content: check the Living information, including the speeches and frames,something about authenticity.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(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 this question.

Your Answer:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(v) Prepare a class diagram for this system. Explain which principles of object-oriented are applied in your design.

Your Answer:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(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#.

Your Answer:


  1. class user
  2. {
  3. private:
  4.     string username;
  5.     string ID;
  6.     string password;
  7. public:
  8.  
  9.     void login(string a, string b)
  10.         while(getInformation)
  11.         {
  12.         if (it exist in database)
  13.          return list[a,b]
  14.         else
  15.          stop
  16.         }
  17.     }
  18.     bool getinformation(arrey){
  19.         if(it is compliant)
  20.        true
  21.         else
  22.        false 
  23.     }
  24. };
  25.  
  26. class customer
  27. {
  28. private:
  29.     string privilege;
  30. public:
  31.     string allowLiving(string merchant_ID)
  32.     {
  33.          if(no not allowed things)
  34.        return link;
  35.          else
  36.          return stop;  
  37.     }
  38.     void stopLiving(string link)
  39.     {
  40.          if(have not allowed things)
  41.        stop; 
  42.     }  
  43.     string allowLiving(string merchant_ID)
  44.     {
  45.          if(no not allowed things)
  46.        return link;
  47.          else
  48.          return stop;  
  49.     }
  50.     string allowselling(string product){
  51.          if(allowed)
  52.        return true;
  53.          else
  54.        return false;
  55.     }
  56. };
  57.  
  58. class customer
  59. {
  60. private:
  61.     double sum;
  62.     arrey star;
  63. public:
  64.     string viptag;
  65.     string perchat(string product)
  66.     {
  67.          if(have enough remaining sum)
  68.        return order num;
  69.          else
  70.        return hint;
  71.     }
  72.     string ask()
  73.     {
  74.        send information;
  75.        return information_back;
  76.     }
  77.     arrey star(product)
  78.     {
  79.        get in arrey star;
  80.     }
  81. };
  82. class merchant{
  83. public:
  84.      string Livinglink;
  85.      arrey products;
  86. private:
  87.       double changePrice(arrey products, int type)
  88. {
  89.          change num;
  90.          return num;
  91. }
  92.       string startLiving()
  93.       {
  94.             get link;
  95.             return link;    
  96.       }
  97.       string showlink(products)
  98.       {
  99.        while(i in products)
  100.        {
  101.              get link;
  102.              return link;
  103.        }
  104.       }
  105. };
  106.  
  107. class product{
  108. public:
  109.        double price;
  110.        string link;
  111.        int sales_Volume;
  112. };
  113. class form{
  114. public:
  115.       string products;
  116. };

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

...全文
137 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

183

社区成员

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

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