联系方式

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

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

日期:2018-08-03 03:55


ICT209 Semester 1 2011

Given Names Surname Student Number Tutor Lab date and time

You need to provide answers to all questions. Total of all marks is 100.

Write your name on each page.

Please read the following question specification and answer the 7 questions that follow. You can

write your answers on both front and back of the question paper. Please label your answer clearly.

Some of the characteristics of a book are the title, author(s), publisher, ISBN, price, and year of

publication.

 Each object of the class bookType can hold the following information about a book: title,

up to four authors, publisher, ISBN, price, and number of copies in stock. You need to keep

track of the number of authors.

 Include member functions to perform the various operations on objects of bookType and

any constructors or destructors as needed.

 Include helper functions as needed.

A vector class is used wherever an array is needed. The vector class provides the same

functionality as an array with the array being encapsulated inside the vector class. So there is

controlled access to the array via the methods of the vector class. There is a bonus of 10 marks if

you can make a templated vector. If you end up with perfect scores for all questions, you will get

100 marks. The 10 marks bonus will come in handy only if you do not get perfect marks for all

questions.

STL containers and algorithms are not allowed. You may use std::string.

1. Draw a detailed UML class diagram for all the above classes. You can answer on the back of

this page.

[15 marks]

Name:_____________________________

2

2. Write the C++ specification for the bookType class. This is the code that goes in bookType.h

[15 marks]

Name:_____________________________

3

3. Write the C++ implementation for the bookType class. This is the code that goes in

bookType.cpp.

[20 marks]

Name:_____________________________

4

4. Write the C++ specification for the vector class. This is the code that goes in vector.h

[10 marks]

Name:_____________________________

5

5. Explain the rationale behind each method of the vector class and any helper functions that you

may have for any of the classes.

[5marks]

Name:_____________________________

6

6. Provide a test plan for the bookType class. Show this in a table.

[15 marks]

Name:_____________________________

7

7. Write a C++ test program to test your bookType class. Allow for 20 books in a booklist.

[20 marks]

****End of questions. 2 blank pages follow***

Name:_____________________________

8

Name:_____________________________


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

python代写
微信客服:codinghelp