`
guoyiqi
  • 浏览: 1018792 次
社区版块
存档分类
最新评论

c++面向对象

 
阅读更多

 

木其工作室 http://www.xmsydw.com

COMPSYS202 / MECHENG270 
Semester Two, 2014 
Project 2 
Due: 24 October 2014 (before 6pm) 
Worth: 20% of Course Mark. 

Introduction 
A team of two software designers are asked to design the software for a Smart Home application 
using Object Oriented design principles covered in the lectures. This project is intended to be 
linked to the learning outcomes specified in the course hanout related to Object Oriented Design. 
Specifically, the following four learning outcomes are addressed: 

 Students will be able to apply the typical OO principles such as Inheritance, association, 
aggregation and encapsulation during the implementation of a small scale project in C++. 
 Students will be able to apply visual notation of UML to describe a real-world problem in an 
object oriented manner. 
 Students will appreciate the difference between requirements and analysis phases for a 
software project. 
 Students will be able to apply a widely used software design pattern called the model-view-
controller (MVC) pattern during their OO analysis. 
Description 
This project is comprised of two parts: System Design and System Implementation. System Design 
contains the functional specification of the system by describing the scenarios, use cases, object 
model and dynamic models. While the implementation of the designed system, using C++ code, is 
covered in part 2. 
Part 1 – System Design 

Among the activities involved in system design, the following will be covered in this project: 
 Scenarios identification. 
 Use cases and actors identification. 
 Object model identification. 
 Dynamic model identification. Scenarios and use cases comes under the requirements phase, while object and dynamic models 
cover the analysis phase of our software project. An identified scenario is given to you, and your 
task is to perform the other three activities around this scenario. 
Scenario identification: 
A scenario is a concrete, informal description of a single feature of the system from a single actor’s 
viewpoint. A scenario for our SmartHome system is given below. In this scenario, the owner of 
SmartHome remotely operates a device in one of the rooms of SmartHome. Note that this scenario 
only describes a single instance. It does not list all possible ways to interact with a device, nor does 
it contain a description of decisions (like alternate paths, error conditions). 
Scenario Name: OperateADeviceInSmartHome 
Participating Actor: Adam: The Owner of SmartHome 
Flow of Events 1- Adam is the owner of SmartHome, and wants to remotely operate the devices in 
SmartHome. 
2- He can access any of the devices using a user interface (UI). 
3- Upon startup, the UI shows a welcome message to Adam. 
4- He is then given a choice to traverse to any of the floors in SmartHome. 
5- Adam selects the ground floor. 
6- The UI then asks Adam to select a room, either Garage or Lobby. 
7- Adam selects Lobby. 
8- The UI displays the list of devices in the Lobby, and again asks Adam to select a device. 
9- Adam opts for bulb. 
10- The next menu is about the three options to operate a device (the window in this 
case): (i) Power management, (ii) Check Status, and (iii) Execute Command. 
11- Adam selects the option Power Management. 
12- He gets a message that the window is currently powered off, and whether he wants it 
to be turned on. 
13- Adam turns on the device, and gets back to the device menu. 
14- This time he selects the second option, i.e., Check Status of the window. 
15- The UI shows a detailed status of the window to Adam. 
16- The details include power status, online status, whether it is safety enabled or not, 
whether it is text enabled or not, whether it can execute command or not. 
17- If the device is text enabled and/or command enabled, the text status and/or range or 
supported commands numbers are also displayed. 
18- After reading the status, he goes back. 
19- If the device is command enabled, Adam selects the third option. 
20- A range of supported commands is displayed. 
21- Adam selects the desired command to achieve desired behavior. 
22- Adam goes back to the device menu. 
23- Adam goes back to the main menu. 






Use cases and Actors identification: 
A scenario represents a concrete situation, while a use case represents a general case. 
Generalizing the above scenario into a use case would result in a very large use case. Thus, your 
task is to split the scenario into self-contained and independent use cases. In other words, you 
need to consolidate the related functionality into single use cases, and split unrelated behaviour 
into several use cases. 
For this part of the project, you are required to 
 Identify and describe some use cases. You are free to add as many use cases as you want, 
including three mandatory use cases: PowerManagement, CheckStatus, and 
ExecuteCommand. 
 Identify the relationships among the use cases. 
 Identify the actor(s) and their interaction(s) with the use case(s). 
 Draw a detailed use case diagram that shows all the use cases, their relationships, and the 
interacting actors. 
 Use the following template to describe each of the use cases: 
Use Case Name 
Participating Actors 
Entry Condition 
Exit Condition 
Flow of Events 

Object model identification: 
Object model emphasizes on the individual concepts that are manipulated by the system along 
with their properties and their relationships. The object model is usually depicted with UML class 
diagrams and include classes, attributes and operations. Your task in this section is to perform the 
following activities: 
 Identify Entity objects, Boundary objects and Control Objects. 
 Identify the properties or attributes of individual objects. 
 Identify relationships among the objects (association, aggregation/composition, 
inheritance). 
 Draw a detailed class diagram that depicts all of the above identifications. 

Dynamic model identification: The dynamic model focuses on the behaviour of the system, and is typically represented via 
sequence diagrams and via state machines. A sequence diagrams shows the interactions among a 
set of objects during a single use case. Your task here is to draw sequence diagrams for each of the 
use cases. That means, you will be essentially mapping the use cases to objects with sequence 
diagrams. 
Part 2 – System Implementation 

In this part, you are required to implement your designed system using C++ code. You will be 
using the identified objects (Entity, Boundary and Control) to apply MVC pattern in this activity. 
Like Project 1, a working system with a limited set of features is given, and your task is to 
complete the system by adding the missing code. A model solution is also given to you as an 
executable binary file (modelSolution.exe), so that you can match your functionality with the 
desired solution. 
Instructions 
 Download the project pack, “Project2.zip” from Cecil, and unzip the files. 
 Run the simulator using the instructions given in the file RunSimulator. 
 Open up a command line terminal, and change the terminal's working directory to the 
Project2 folder. 
 Type make to compile the source code. 
 Type ./release/assign2.exe to run the program. You would see the welcome message and 
a menu on your terminal. 
 Your task is to complete the system implementation by adding new program files using 
MVC pattern. For example to implement functionality of a room, you would require three 
files: RoomManager, RoomModel and RoomUI. 
 You can execute the model solution by typing ./release/modelSolution.exe. This is a 
complete solution, and you may use this as a guide to your project. 

Marking Details 
Smart Home Control System 100 Marks 

Use cases and actors identification. Use case descriptions. Use case Diagram. 20 
Object model identification. Class Diagram. 20 
Dynamic model identification. Sequence Diagrams 20 
System implementation using MVC pattern 35 
Declaration and feedback page at the end of this doc. (One pdf scan for each student) 05 Typical Reasons to Lose Marks 
When marking, we will give each project a small amount of time to get it running and test it. 
Occasionally people will submit something that doesn't work immediately and the marker has to 
spend some time trying to fix it. While it wouldn't be fair to give you 0 marks because you had a 
typo stopping an otherwise good program from running, it's also not reasonable to expect the 
markers to spend hours debugging your projects to get them to run well enough to assess fairly. 
The following are examples of things people have done which make fair marking very difficult. 
 Program does not compile at all. 
 Program doesn't work on Linux, seems to have been written on Windows. 
 Commenting was really poor; we couldn't work out how to fix the bug stopping it from 
working. 
Submission 
You should submit a .zip file to the assignment dropbox before the deadline. We will post the link 
to the dropbox on Cecil two weeks prior to the deadline. Make sure that you name the .zip file 
with your own studentUPI and your team mate’s studentUPI separated with a dash. The following 
is an example of a submission with the expected name and contents. 

xav023-trb576.zip 

 A zip file containing the code for your project2 (i.e. all CPP and HPP files and the modified 
‘Makefile’) – don’t submit SHAPI and SHSIM folders. 
 All use cases, object (state) diagrams and dynamic diagrams in quality pdf format. 
 Scan of next page with your signature in the declaration, one for each student (make sure 
that the scan is clear enough to read). 

Important Points about Submission 
1- There will be only one submission per group, with the naming convention thereof. 
2- The dropbox will remain open until 24 hours after project deadline. However, late submissions 
will incur penalties as follows. 
 Late submissions until 12 hours after deadline incur 20% penalty 
 Late submissions until 24 hours after deadline incur 50% penalty 
3- All contents of your assignment must be submitted at the same time in one submission. 
Otherwise, the most recent submission will override the previous ones. 
4- Excuses regarding late submissions, or submitting wrong contents won’t be accepted! 
5- Each student will evaluate their project partners via peer review forms. The peer review forms 
must be kept confidential, and will be submitted to a different dropbox. We will provide you 
with the forms and more information regarding the dropbox later. 

Declaration 
I am aware of and understand the University’s policy on plagiarism and I certify that this 
assignment is my own work. In addition, I understand that any false claim in respect of this work 
will result in disciplinary action in accordance with University regulation. 

Name: .................................................................... UPI: ..................................... Uni ID: ............................................. 
Sign: ......................................................................................................................... Date: ................................................ 

Feedback 
Please provide us your feedback on this assignment. Note that this section is not compulsory. 

1. How much time did the assignment take overall? 
....................................................................................................................................................................................................... 
2. What areas of the assignment did you find easy? 
....................................................................................................................................................................................................... 
3. What areas of the assignment did you find difficult? 
....................................................................................................................................................................................................... 
4. Which topics of the course did the assignment most help you understand? 
....................................................................................................................................................................................................... 
5. Any other comments: 
.......................................................................................................................................................................................................

分享到:
评论

相关推荐

    C++面向对象程序设计教程——课件PPT

    在“C++面向对象程序设计教程——课件PPT”中,我们可以深入学习这一主题,由陈维兴和林小茶编著,清华大学出版社出版。这套教程通过一系列的PPT章节,详细讲解了C++面向对象编程的关键概念。 首先,第1章“面向...

    C++面向对象程序设计 经典例题 附练习题

    本资料包“C++面向对象程序设计 经典例题 附练习题”显然是为了帮助学生深入理解C++的面向对象特性,并通过实例和练习来巩固学习成果。 在C++中,面向对象的主要概念包括: 1. **类**:类是创建对象的模板或蓝图,...

    c++面向对象编程实例大全

    《C++面向对象编程实例大全》是一本专为初级学习者设计的教程,旨在通过丰富的实例深入浅出地讲解C++的面向对象编程概念。面向对象编程(Object-Oriented Programming,简称OOP)是C++的核心特性,也是现代软件开发...

    C++面向对象程序设计PDF电子书与参考答案

    以下是对"**C++面向对象程序设计PDF电子书与参考答案**"中的关键知识点的详细阐述: 1. **封装**:封装是面向对象编程的基础,它将数据(属性)和操作这些数据的方法(函数)捆绑在一起,形成一个独立的实体——...

    c++面向对象程序设计第三版谭浩强教学大纲.pdf

    "C++面向对象程序设计第三版谭浩强教学大纲.pdf" 本资源摘要信息涵盖了C++面向对象程序设计的基本概念、数据存储、程序设计初步、函数、数组、指针、用户自定义数据类型、类和对象的程序设计等方面的知识点。 第一...

    Visual C++ 面向对象编程教程——王育坚

    《Visual C++ 面向对象编程教程——王育坚》是一本专为学习MFC(Microsoft Foundation Classes)和面向对象编程技术而设计的教学资料。该教程以幻灯片的形式呈现,结合实例与详细的讲解,使得学习过程更为直观且易于...

    C++面向对象程序设计答案

    本资料“C++面向对象程序设计答案”针对清华大学出版社出版的相关教材,提供了课后习题的解答,旨在帮助学习者深入理解并熟练掌握C++的面向对象编程技术。 1. **类与对象** - 类是C++中的蓝图,定义了一组数据成员...

    c++面向对象程序设计答案 陈维新 林小茶

    《C++面向对象程序设计答案》是陈维新和林小茶共同编著的一本教材,专注于讲解C++语言中的面向对象编程概念和技术。这本书的第三版提供了3-5章的编程题,旨在帮助读者通过实践来巩固所学的知识。在深入探讨这个主题...

    C++面向对象实验代码实验2

    这个实验代码`test2`提供了一个实践C++面向对象编程的平台,通过分析和运行这些代码,你可以更好地理解面向对象编程的各个方面,并提升自己的编程技巧。在学习过程中,一定要动手尝试修改和扩展代码,这样能更深刻地...

    c++面向对象程序设计(第6版)Walter Savitch 书中的 c++题库

    《C++面向对象程序设计(第6版)》是由Walter Savitch著,佟俐鹃改编的教材,这本书深入浅出地介绍了C++语言的面向对象编程思想。书中的"test bank"是配套的自测题库,包含了丰富的练习题和答案,旨在帮助读者巩固...

    c++面向对象 背单词系统

    《C++面向对象编程实现的背单词系统》 在计算机科学领域,编程语言是实现各种应用的核心工具。C++作为一款强大的、通用的编程语言,因其高效性、灵活性和丰富的库支持,常被用于开发复杂系统。面向对象编程(Object...

    c++面向对象程序设计课后习题答案

    本资料集是关于“C++面向对象程序设计”的课后习题答案,旨在帮助学生深入理解和实践C++的OOP概念。 在C++中,面向对象的核心概念包括类(Class)、对象(Object)、继承(Inheritance)、多态(Polymorphism)和...

    C++面向对象程序设计_第三版_谭浩强_课后答案[1-14章

    根据提供的文件标题、描述以及部分无法识别的内容,我们可以聚焦于《C++面向对象程序设计》这本书,特别是由谭浩强编著的第三版,并且关注的是该书第1-14章的课后习题答案。 ### C++面向对象程序设计概述 C++是一...

    《C++面向对象程序设计》第2版编程题答案

    《C++面向对象程序设计》是C++编程领域的一本经典教材,由清华大学出版社出版,龚晓庆、付丽娜等多位专家共同编著。这本书深入浅出地讲解了C++语言的核心概念,特别是面向对象编程(OOP)的思想和技术。第二版在第一...

    C++面向对象程序设计课程大作业-通讯录管理系统

    本项目是学习C++面向对象编程的实战案例,通过设计和实现通讯录管理系统,学生可以深入理解面向对象编程的概念和技巧,并提升解决问题的能力。同时,项目的完整流程,包括需求分析、设计、编码、测试,也能帮助学生...

    c++面向对象程序设计语言重点难点复习题及答案.doc

    首先,我们来看看一些关于C++面向对象的重点和难点: 1. 数据共享与保护: - **静态成员**:类的静态数据成员属于类本身,而不是类的实例。这意味着所有类对象共享同一份静态数据成员的拷贝,它们是类的属性,而...

    C++面向对象程序设计课程设计报告.pdf

    C++面向对象程序设计课程设计报告.pdf 本课程设计报告主要介绍了C++面向对象程序设计的相关知识点,并对公司人员管理系统进行了设计和实现。本报告共分为五个部分:引言、课程设计报告、系统测试、心得体会和参考...

    C++面向对象程序设计(第2版)代码

    《C++面向对象程序设计(第2版)》是谭浩强教授编著的一本经典教材,它深入浅出地介绍了C++编程语言的核心概念和面向对象编程思想。这本书是针对中国高等院校计算机基础教育课程体系规划的一部教材,旨在帮助学生...

    C++面向对象 杭电

    C++面向对象

Global site tag (gtag.js) - Google Analytics