中山大学2020年软件工程初级实训成果

历经两个周末,终于把这个Agenda-2020系统搞出来了,发篇博文庆祝一下~~

先展示一下成果吧~
学了一学期的C++到底能做什么呢?快来看看这个Agenda-2020系统吧~

如果你看完视频意犹未竟,那就来看看这系统是怎么实现的吧~

UI类(关于用户交互的类)

AgendaUI.hpp

#pragma once
#ifndef AGENDAUI_H
#define AGENDAUI_H

#include "AgendaService.h"
#include <iostream>
#include <string>

class AgendaUI {
   
public:
    AgendaUI();
    void OperationLoop(void);

private:
/**
* constructor
*/
void startAgenda(void);

   /**
    * catch user's operation
    * @return the operation
    */
   std::string getOperation();

   /**
    * execute the operation
    * @return if the operationloop continue
    */
   bool executeOperation(std::string t_operation);

   /**
    * user Login
    */
   void userLogIn(void);

   /**
    * user regist
    */
   void userRegister(void);

   /**
    * user logout
    */
   void userLogOut(void);

   /**
    * quit the Agenda
    */
   void quitAgenda(void);

   /**
    * delete a user from storage
    */
   void deleteUser(void);

   /**
    * list all users from storage
    */
   void listAllUsers(void);

   /**
    * user create a meeting with someone else
    */
   void createMeeting(void);

   /**
    * list all meetings from storage
    */
   void listAllMeetings(void);

   /**
    * list all meetings that this user sponsored
    */
   void listAllSponsorMeetings(void);

   /**
    * list all meetings that this user take part in
    */
   void listAllParticipateMeetings(void);

   /**
    * search meetings by title from storage
    */
   void queryMeetingByTitle(void);

   /**
    * search meetings by timeinterval from storage
    */
   void queryMeetingByTimeInterval(void);

   /**
    * delete meetings by title from storage
    */
   void deleteMeetingByTitle(void);

   /**
    * delete all meetings that this user sponsored
    */
   void deleteAllMeetings(void);

   /**
    * show the meetings in the screen
    */
   void printMeetings(std::list<Meeting> t_meetings);
   // dates
   std::string m_userName;
   std::string m_userPassword;
   AgendaService m_agendaService;
};

#endif

AgendaUI.cpp

#include "AgendaUI.h"
#include "User.h"
#include "Meeting.h"
#include <iostream>
#include <iomanip>
using namespace std;
AgendaUI::AgendaUI()
{
   
    m_userName = "UNDEFINED";
    startAgenda();
}
void operateMessage(void)
{
   
    cout << "\n---------------------------------------------------Agenda----------------------------------------------------" << endl;
    cout << "Action :\n"
        "o    - log out Agenda\n"
        "dc   - delete Agenda account\n"
        "lu   - list all Agenda user\n"
        "cm   - create a meeting\n"
        "amp  - add meeting participator\n"
        "rmp  - remove meeting participator\n"
        "rqm  - request to quit meeting\n"
        "la   - list all meeting\n"
        "las  - list all sponsor meetings\n"
        "lap  - list all sponsor meetings\n"
        "qm   - query meeting by title\n"
        "qt   - query meeting by time interval\n"
        "dm   - delete meeting by title\n"
        "da   - delete all meetings"
        << endl;
    cout << "----------------------------------------------------------------------------------------------------------------\n"
        << endl;
}
void operateMessage2(void)
{
   
    cout << "---------------------------------------------------Agenda-------------------------------------------------------" << endl;
    cout << "Action :\n"
        "l    - log in Agenda by user name and password\n"
        "r    - register an Agenda account\n"
        "q    - quit Agenda"
        << endl;
    cout << "----------------------------------------------------------------------------------------------------------------" << endl;
    cout << "Agenda :~$ ";
}
void AgendaUI::OperationLoop(void)
{
   
    string opera ;
    while ((opera = getOperation()) != "q")
    {
   
        executeOperation(opera);
        operateMessage2(
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CSDN是中国领先的技术社区和垂直门户网站,提供了丰富的IT技术资源和交流平台。中山大学2020考研是指在2020年中山大学的研究生招生考试。以下是有关CSDN中山大学2020考研的回答。 中山大学是一所位于广州市的著名综合性大学,拥有杰出的教学和研究力。每年,中山大学都会组织研究生招生考试,吸引了全国各地的优秀学子前来报考。CSDN作为国内知名的IT技术社区,也为考研学子们提供了相关的学习资料、经验分享和讨论交流的平台。 在CSDN中山大学2020考研板块,你可以找到大量关于中山大学招生政策、专业介绍、历年真题、备考资料以及考研心得等信息。在这里,考研学子可以与其他考生进行交流和沟通,分享备考心得和应试经验,互相帮助和鼓励。同时,也可以得到在中山大学研究生阶段学习的经验和建议,了解研究生生活和科研环境。 在CSDN中山大学2020考研板块中,你可以获取到与中山大学2020考研相关的重要信息,比如招生计划、报名时间、考试科目、考试形式等内容。这些信息对于考生制定备考计划、选择研究方向和准备考试都非常有帮助。 总之,CSDN中山大学2020考研板块是一个为考研学子提供信息交流和资源共享的平台。通过在CSDN上参与讨论和获取相关信息,考研学子们可以更好地备考中山大学2020考研,提高自己的竞争力,现自己的研究生梦想。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值