首页 > > 详细

辅导 C++ bookType class 、讲解C++ bookType大程序 解析C/C++编程|讲解SPSS

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:_____________________________
8Name:_____________________________
联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!