联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> C/C++编程C/C++编程

日期:2018-11-18 09:07

Assignment 5- Inheritance

Assignment Overview

This assignment aims at understanding class hierarchies and two ways of software

reusability, i.e. composition and inheritance, and master the definition of the classes

derived from existing classes, accessing of class members in different inheritance and

overriding member functions of derived classes. The following steps of coding a program

are

1. Problem statement: formulate the problem.

2. Analysis and design: describing the properties of the class by natural language.

3. Implementation: Defining the constructor/destructor of derived classes and

overriding member functions of derived classes.

4. Testing: explain how you have tested and verified your C++ program.

What should be submitted?

A short report (up to a few pages of texts plus C++ source codes) detailing for all the

questions of the assignment. The answer for each question should follow the above five

steps:

1. Steps 1 and 2. (20% of the total marks for that question)

2. Step 3 (implementation): your C++ source code including the comments. (60%)

3. Step 4 (testing): you will explain how you have tested the correctness of your C++

program and will include some sample runs of your C++ Programs. (20%).

Testing result must be shown by screenshot.

The report is written in Microsoft Word format. The report is submitted to website:

www.cs-sut.com.

Problem

Given the class hierarchy described by the UML diagram (on the next page).

(1) Define the Time class and its derived class ExtTime according to the UML diagram.

(2) Design an iWatch class that has a name and an ExtTime class object. The iWatch class

has the following operations:

a) Show the current time in china;

b) Show the time in another zone corresponding to the current time.

(3) Write a test program that tests the iWatch class.

(4) Draw a UML diagram having the Time, ExtTime and iWatch classes


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp