国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

COMP26020代做、代寫C++設(shè)計程序

時間:2023-12-08  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯


COMP26020代做、代寫C++設(shè)計程序
COMP26020 – Assignment 2
Library Management Software in C++
A. Assignment
The goal of this assignment is to implement a set of C++ classes that aim to be used in a library management
software. The library holds documents of different types (novels, comics and magazines) with various attributes
(title, author, etc.) and users can borrow and return documents.
• library.h has the different classes definitions including inheritance relationships as well as the
prototypes for all classes’ methods.
• library.cpp contains the implementations of the classes.
• test-suite.cpp, catch.h, and catch.cpp implement a test suite that checks the correctness of the
library code.
The code in your repo has everything already implemented and it’s 100% functional and (mostly) correct!
Wait. What’s the point of this assignment then?
Well, the code was written by someone who only watched some of the videos in the first week and then gave up.
As such, the code is more C than modern C++, it does not use the standard library, and it does not follow any of
the C++ design approaches. Ah, and it also has a few memory leaks. This is not good C++ code.
Your actual goal is to rewrite library.{cpp,h} using the concepts and approaches we covered in the lectures.
This includes:
• RAII
• new/delete considered harmful
• C-arrays, C-strings considered redundant
• C++ standard library containers, utilities, and algorithms
• Improved type safety
• Using linters, static analyzers, and the C++ Core Guidelines to uncover errors and bad coding patterns
Your rewrite should not change the externally visible behaviour of the library classes: any possible external
function calling any of the public member functions in library.h should behave the exact same way it did before
the rewrite. In practice this means that:
a) You are allowed to edit only library.h and library.cpp
b) You are not allowed to remove existing public member functions in library.h
c) You are not allowed to change the visibility of existing member functions
d) You are not allowed to change the argument types or the return value types of public member functions
in library.h (with one exception, see below)
e) Your member functions need to return the exact same thing they would have returned originally.
On the other hand, you are free to:
a) add new member functions (private, protected, or public)
b) change the internal implementation of any member function
c) Add/remove private member variables in library.h or change their types.
The only allowed change of types in function prototypes is between types that are implicitly convertible. For
example, an int with allowed values 0/1 can be replaced by a bool. The testing code is also designed to treat all
different kinds of strings as interchangeable. If you’re not sure, test it.
B. How to approach the assignment
As is, the code is extremely unsafe. Try to use (modern) C++ capabilities that attack that problem first. If you do it
correctly, you will be able to remove large parts of the code, eliminate some warnings, and multiple guidelines
suggestions. This will make it much easier to identify any remaining issues and understand what is causing the
various warnings.
A related advice is to keep thinking about whether you actually need every piece of code in your code base. If you
can remove some function/loop/code-block without affecting the functionality of the program, remove it.
Test your code after every single change you make. Does it still compile? Does it still pass the tests? If you made a
mistake somewhere, it’s better to find out immediately rather than after another 5-10-20 changes.
Warnings from the compiler, clang-tidy and the static analyzer are often interconnected and multiple warnings are
just symptoms of the same bad design choice. In such cases, try to eliminate the actual problem, not each
symptom individually.
C. Building and testing
Test Suite
To run and test your implementation you are given a basic test suite in the form of a C++ file, test-suite.cpp. It’s
a C++ program (i.e. it contains a main function) that includes library.h. It instantiates/manipulates objects from
all the library classes and performs sanity checks. This program uses the Catch1
test framework and requires two
additional source files to be compiled: catch.cpp and catch.h. You can compile the program manually:
$ g++ -std=c++17 test-suite.cpp library.cpp catch.cpp -o test-suite
and execute the test suite with:
$ ./test-suite
You don’t need to understand the testing code fully, but if you get failed tests, it might be useful to check the code
that is associated with the failed test in order to understand what went wrong. Overall, the suite is divided into
tests cases enclosed into TEST_CASE() { ... } statements. A test case will fail when one of the
REQUIRE( <condition> ) or CHECK( <condition> ) statements it contains fails, i.e. when condition evaluates
to false.
To complete the assignment you do not need to understand the content of catch.h and catch.cpp.
Passing all tests does not mean your code is 100% correct. Your solution is 100% correct only if the public
behaviour of all public methods remains exactly the same under all possible usage scenarios2
. When marking, we
will test whether your code is correct with a special test suite containing additional cases. So, make changes
carefully. If you are not certain about some change, add your own test case to test that change or discuss it with
us in the lab.
Make
For your convenience, we provide a Makefile that can help you automate building and testing your code.
To build the whole test suite and check the library code for warnings:
$ make
To run the gcc static analyzer
$ make analyze
1 https://github.com/catchorg/Catch2
2 You can assume that input arguments are always valid though: no null pointers, number values are within valid ranges,
filenames are legal, etc.
To run the C++ core guidelines checker and parts of the clang static analyzer:
$ make guidelines
You can change the three variables at the top of the Makefile to match your setup. CXX should point to your C++
compiler. Make sure it’s one from the last 3 years, supporting C++ 17. Also, note that make analyze will only work
with g++>=10.0. Use your compiler’s static analyzer, if you’re using another compiler. TIDY chooses which clangtidy to use. The default is to use one in the system path.
Workflow options
1. Lab workstations locally
The lab Linux workstations are already setup in the exact same way as the machine where your code will be
tested. So, it’s the easiest option to use and you will be 100% certain that if your code runs correctly for you, it will
run correctly for us too.
2. Lab workstations remotely
Same advantages as above but you can connect to them from home (through VPN) or from other university
locations. You will need an ssh client, such as openssh (Linux) or PuTTY (Windows). To connect set the remote
hostname to one in the range e-10cki18001.it.manchester.ac.uk to e-10cki18060.it.manchester.ac.uk.
For example in Linux you can do:
$ ssh -Y <username>@e-10cki18001.it.manchester.ac.uk
If the command says that it cannot find a route to the host, try a different hostname in the valid range.
3. Your own Ubuntu Installation (VM or not)
For Ubuntu 22.04 (preferred):
$ sudo apt install make g++-11 clang-tidy-12
For Ubuntu 20.04:
$ sudo apt install make g++-10 clang-tidy-12
and edit Makefile to say CXX := g++-10
With these changes you should be getting results similar to what you would get in the lab. But keep in mind that
we will not be able to help you if you run into any problems caused by differences in the setup.
4. Other systems
This is the riskiest option. We will not be able to help you with any technical issues. It’s also possible that your
system displays different behaviour than the lab workstations. For example, we have seen multiple cases where
the submission does not compile on our side because of a missing header file, but does compile on the student’s
side because their compiler indirectly included that header. So, be aware of the risks and try to test your code on a
lab workstation before submission.
The main thing to do is to install an appropriate compiler and clang-tidy. After that set CXX and TIDY in the
makefile to point to your compiler and clang-tidy respectively.
Building and running the test suite only requires a relatively modern C++ compiler so this should be easy to get
working correctly. make analyze will only work with g++ > 10.0. If you don't have access to an appropriate version,
check whether your compiler has a static analyzer you can use. make guidelines requires clang-tidy. If you're using
Visual Studio, you could use the C++ Core Check instead.
If you don't have a recent g++ or clang-tidy, consider connecting to the lab workstations and testing your code
there following the instructions above.
D. Submission
Deliverables, Submission & Deadline
There are two deliverables: the completed library.cpp and library.h files. The submission is made through
the CS Department’s Gitlab. You should have a fork of the repository named “26020-lab2-S-CPlusPlus_<your
username>”. Make sure you push to that precise repository and not another one, failure to do so may result in
the loss of some/all points. Submit your deliverables by pushing the corresponding files on the master branch and
creating a tag named lab2-submission to indicate that the submission is ready to be marked.
The deadline for this assignment is 08/12/2022 6pm UTC.
Submission Checklist
1. Does your submission compile successfully on the lab machines?
2. Does your code pass all tests?
3. Have you committed all local changes? Check using git status.
4. Have you pushed your changes to the right repository?
5. Have you tagged your latest commit with “lab2-submission”?
Marking Scheme
The exercise will be marked out of 10, using the following marking scheme:
• The program is functional, and passes the basic test suite /1
• The program passes all extended tests /1
• The code takes advantage of C++ capabilities to make the code clearer and more concise /1
• The library code follows RAII principles /1
• The library code uses Standard Library containers and data types whenever appropriate /2
• The library code uses Standard library algorithms whenever there is a clear benefit from doing so /1
• The library code does not produce significant warnings when compiled with -Wall, -Wextra, -Wpedantic,
or the static analyzer and it does not suffer from memory errors /1
• The library code follows the C++ Core Guidelines (at least the ones that we discussed in the lectures, as
well as the ones tested by clang-tidy) /1
• The code is clear, well commented, and follows good practices /1
Plagiarism/Collusion
This is an individual coursework exercise. You should not share your code with others, you should not try to see or
copy the source of anyone else, and you should not work together with other people. Exchanging ideas can also
be collusion3
 and it will definitely treated as such if the submissions are unreasonably similar.
All submissions will be checked using a standard code plagiarism detection program, as well as a checker tailored
to this assignment. We will manually examine any submissions that are flagged. If their similarities are because
they contain the code we gave you or because they applied the same obvious changes, then there will be no
further action. If this is not the case and their similarities are extremely unlikely to be due to chance, they will
either be penalised or forwarded to a disciplinary panel.
 C S Guidance UoM-wide Guidance Academic Malpractice Procedure
3 Academic Malpractice Procedure – 3.1.2.3:“The methods of collusion may include, but are not limited to, sharing of work,
ideas or plans by social media or other electronic communication means, and/or physical sharing of work, ideas or plans.”
E. FAQ (Check blackboard for updates)
0. I have the X problem on my Y laptop If you are not confident that you can fix your problems easily, just connect
to the lab workstations and work there. This is the point of lab
workstations to begin with: a single hardware/software configuration
where the code is guaranteed to run and you can be confident that we will
get the same results you get when we test your code.
1. "unrecognised command line option -
fanalyzer"
Do you have g++ > 10 installed? If you don't have g++ on your platform,
find the static analyzer of your compiler or try the g++ static
analyzer installed on the lab workstations
2. command g++-11 not found You don't have g++-11. Either install it or modify CXX in the Makefile to
point to the binary of your preferred compiler
3. Do I need make guidelines and make analyze? No, you can identify all code issues without using the two tools. But why
make your life difficult? Just use the lab workstations.
4. Do I need to eliminate all warnings from
make analyze and make guidelines?
Probably not. Some warnings might be bogus. Use your judgement. Also
suppressed warnings in make guidelines are about library code, so it's
beyond the scope of this coursework
5. If I eliminate all guideline warnings, will I get
the full mark?
Probably not. clang-tidy does not enforce all guidelines, so there will be
issues with your code that it will not complain about.
6. How will I know that I have fixed the code?
What does the perfect solution look like?
There is no way of telling you that without giving you an exhaustive list of
what you need to do. But if you attack the big problems that I kept talking
about in the lectures (i.e, "new considered harmful", RAII, "C-arrays
considered redundant", avoiding explicit bounds checking), you should
already be close to a perfect solution.
7. Can I modify the argument types of any
member functions?
Normally no. Straightforward substitutions like bool instead of an integer
that holds binary values, or std::string / std::string_view instead of cstrings are normally okay. The testing code is written in a way that it will
handle such cases gracefully. Other substitutions might change the public
interface and thus break the testing code.
If you just want to change how you use a function internally, just overload
the function with a version that has your preferred argument types.
8. "cc1plus: warning: analysis bailed out early" This only indicates that the code is too complex for the static analyzer. You
can ignore it.
9. Can I mix raw and smart pointers? Yes. Smart pointers are meant to be used only for owning data. Replacing
non-owning raw pointers with smart pointers is usually wrong.
10. Can we add a destructor for class X, even if
it was not originally declared in library.h? Can
we remove the destructor for class Y, even if
was originally declared? Can we remove a
copy/move constructor/assignment operator?
Yes, yes, and yes. The class has the set of five special methods whether
you declare them explicitly or not (unless you set them to deleted of
course). Assuming you don’t do anything that affects visibility, there is no
change to the public interface. The only change is whether the special
methods are explicit or not
11. Can we remove/modify/add private
variables?
Yes. The testing code cannot see private variables or functions, so any
changes you make cannot affect the tests.
12. The test suite reports something like:
test-suite.cpp:201: FAILED:
 REQUIRE( some_fnct() )
with expansion:
 false
REQUIRE checks whether whatever is in the following () evaluates to true
or 1. The message indicates that some_fnct() returns the wrong value. Try
to figure out why.
13. Can I change the arguments/return
values/methods to const?
Definitely not the return values. External code might depend on them
being non-const, even if they are not meant to be modified. Modifying
arguments and methods should be okay.
14. Can I change an argument from pointer to
reference?
NO! Pointers and references have similar properties but they are not
syntactically interchangeable. If I call a function passing it a pointer and
you change that function to get a reference, then the testing code will not
compile correctly.
15. When I run make guidelines I get this error:
clang-tidy: not found
The makefile cannot find the system clang-tidy. Install one.
16. Can I cut everything in library.h and paste it
in library.cpp?
NO! This will break make and modular compilation in general, i.e. your
code will not compile when tested. Also it's an awful coding practice.
17. Can we use standard library header X/Y/Z? You are allowed to use any standard library header you want, as long as
that header exists in C++ 17. It's not a great idea to use some of these
headers, but it will not break the testing code.
18. "No space left on device"! What happened? You've ran out of space. If you are using a lab machine, you don't have
unlimited space in your university's home folder. Use du -sm * from the
command line in your home folder to figure out what’s using all your
space. If you see something that you don’t need and it takes a lot of space,
delete it and try again.
19. My tagged commit did not modify library.
{cpp,h} but an earlier commit did. Will this
cause a problem?
No, it will be fine. Our code will clone your whole repo at the point in time
you tagged it, not just the files you committed when you tagged it. Out of
this clone, we will copy library.{cpp,h} into our own folder where we will
build it with our own Makefile.
E. Appendix
Class Hierarchy
The library.h header defines 5 classes which are briefly presented below. Note that more detailed information
about the methods is present in the header’s source code in the form of comments.
• Document is an abstract class defining attributes and methods common to all the documents that can be
held in the library. Attributes include the document’s title and quantity held in the library. It defines
various methods for printing the document’s information on the standard output, getting its concrete type
(novel/comic/magazine), and various getters/setters including methods for borrowing/returning the
document from/to the library.
• Novel, Comic and Magazine represent the concrete types of
documents. Each inherits from Document as depicted on the figure
on the right. They differ slightly in attributes: a novel and a comic
have an author, while comics and magazines have an issue number.
Each class also defines the relevant getters/setters.
• The last class, Library, represents the library i.e. a collection of
documents. The documents are held in an array of Document pointers. The library class defines various
methods for actions such as adding, removing, searching, borrowing, returning documents, printing the
library content on the standard output or dumping it in a CSV file.
Documents/Library Printing and CSV Output Formats
The print() method, when called on a novel, prints on the standard output the novel’s attributed in this format:
Novel, title: Monstrous Regiment, author: Terry Pratchett, quantity: 1
For a comic:
Comic, title: Watchmen, author: Alan Moore, issue: 1, quantity: 10
And for a magazine:
Magazine, title: The New Yorker, issue: 1, quantity: 20
The print() method called on a library containing these 3 documents produces:
Novel, title: Monstrous Regiment, author: Terry Pratchett, quantity: 1
Comic, title: Watchmen, author: Alan Moore, issue: 1, quantity: 10
Magazine, title: The New Yorker, issue: 1, quantity: 20
The dumpCSV() method called on the same library produces a file with the following format:
novel,Monstrous Regiment,Terry Pratchett,,1
comic,Watchmen,Alan Moore,1,10
magazine,The New Yorker,,1,20
Document class hierarchy

請加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

掃一掃在手機打開當前頁
  • 上一篇:CPT109程序代做、代寫C/C++編程語言
  • 下一篇:代寫COMP3023、C/C++語言編程代做
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強度疲勞振動
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務(wù)平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 寵物飼養(yǎng) 十大衛(wèi)浴品牌排行 suno 豆包網(wǎng)頁版入口 wps 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    国模吧一区二区三区| 国产v综合v亚洲欧美久久| 国产男女在线观看| 久久黄色av网站| 色综合视频一区中文字幕| 欧美在线亚洲在线| 久草热久草热线频97精品| 动漫3d精品一区二区三区| 成人在线小视频| 欧美激情喷水视频| 国产日韩三区| 久久国产精品久久久| 国模精品视频一区二区三区| 久久精品久久久久久| 日韩欧美精品久久| 久久香蕉综合色| 熟女少妇精品一区二区| 久久久999视频| 欧美一级日本a级v片| 超碰国产精品久久国产精品99| 国产精品初高中精品久久| 狠狠干一区二区| 国产精品精品视频| 国产日韩在线精品av| 精品国产乱码久久久久久郑州公司 | 狠狠色狠狠色综合人人| 久久久久北条麻妃免费看| 日韩av中文字幕第一页| 九色综合日本| 欧美二区在线看| 国产精品国内视频| 国产欧洲精品视频| 亚洲一区二区三区乱码| 69av视频在线播放| 日韩黄色片在线| 久久久精品国产一区二区| 美女在线免费视频| 欧美精品情趣视频| 97精品一区二区视频在线观看| 亚洲高清乱码| 日韩视频欧美视频| 国产性生交xxxxx免费| 美日韩精品视频免费看| av一区二区三区四区电影| 懂色av一区二区三区在线播放| 国产精成人品localhost| 日本不卡在线播放| 国产精品久久一区主播| 国产欧美精品一区二区三区-老狼| 亚洲永久一区二区三区在线| 久久一区二区三区欧美亚洲| 欧美自拍视频在线| 欧美成人在线网站| 国产精品av在线播放| 亚洲免费久久| 国产成人无码a区在线观看视频| 蜜桃久久精品乱码一区二区| 欧美精品一区三区| 91免费精品视频| 欧美在线视频一区二区| 国产精品久久久久久av福利软件 | 国产精品视频一区国模私拍| 国产又粗又爽又黄的视频| 亚洲欧美日韩精品久久久| 久久久www成人免费精品| 国产精品综合久久久久久| 日韩视频免费在线播放| 蜜月aⅴ免费一区二区三区| 久久精品国产精品国产精品污| 欧美亚洲在线视频| 欧美精品久久久久久久久久| 久久久久久亚洲精品| 国产噜噜噜噜噜久久久久久久久 | 国产99久久精品一区二区 夜夜躁日日躁| av一区二区三区免费观看| 欧美在线一区二区视频| 一级特黄录像免费播放全99| 日韩有码在线电影| 97色伦亚洲国产| 精品一区二区三区视频日产| 日本中文字幕久久看| 久久99久久久久久久噜噜| 久久精品国产第一区二区三区最新章节 | 色妞在线综合亚洲欧美| yellow视频在线观看一区二区| 欧洲精品久久| 亚洲wwwav| 久久99精品久久久久久噜噜| 久久精品2019中文字幕| 久久青青草综合| 国产精品一区二区三区在线观 | 午夜精品一区二区在线观看| 国产精品久久久久影院日本| 7777精品伊久久久大香线蕉语言| 精品少妇人欧美激情在线观看| 日本三级久久久| 亚洲欧洲三级| 伊人久久大香线蕉精品| 精品久久久久久乱码天堂| 久久久精品影院| 色婷婷久久av| 日韩在线小视频| 国产成人精品视| 7777在线视频| 91传媒免费视频| 99精彩视频| 99视频在线| 97国产在线播放| 国产精品一区二区三区免费视频| 免费在线国产精品| 欧美一区二区影视| 青草成人免费视频| 人禽交欧美网站免费| 人体精品一二三区| 欧美亚洲一级二级| 青草成人免费视频| 欧美在线一级va免费观看| 青青视频免费在线| 欧美亚洲免费高清在线观看| 青青视频免费在线观看| 欧美亚洲国产精品| 欧美日韩亚洲一区二区三区四区 | 狠狠精品干练久久久无码中文字幕 | 国产伦精品一区二区三区高清版| 红桃一区二区三区| 精品视频一区二区三区四区| 欧美日韩亚洲国产成人| 欧美在线视频免费| 欧美精品久久久| 国内精品视频一区二区三区| 国产一级二级三级精品| 国产美女99p| 成人毛片100部免费看| 成人一区二区av| 91精品在线观看视频| 国产av无码专区亚洲精品| 日韩一区av在线| 国产精品观看在线亚洲人成网| 九九精品在线观看| 动漫3d精品一区二区三区| 日韩美女在线观看一区| 激情欧美一区二区三区中文字幕| 黄色污污在线观看| 国产日韩欧美精品| 啊啊啊一区二区| 久久人91精品久久久久久不卡| 久久久久久久国产精品视频| 国产精品久久久影院| 在线观看一区二区三区三州| 五月天在线免费视频| 欧美自拍大量在线观看| 国产一区二区三区黄| av一区二区三区四区电影| 国产成人一区二| 国产精品三级在线| 欧美精品电影在线| 日本va中文字幕| 国产一级片91| 国产精品12345| 国产精品视频内| 一区二区三区四区不卡| 日产精品久久久一区二区| 狠狠久久综合婷婷不卡| 91精品国产综合久久香蕉922| 久久久精品免费视频| 一道精品一区二区三区| 欧美中在线观看| 成人美女免费网站视频| 色老头一区二区三区| 欧美激情网友自拍| 青青草原一区二区| 国产精品亚洲自拍| 日韩中文字幕网| 久久99国产综合精品女同| 日韩美女免费视频| 风间由美久久久| 久久精品91久久久久久再现| 伊人婷婷久久| 精品人伦一区二区三区| 久久天天东北熟女毛茸茸| 欧美xxxx做受欧美.88| 天天综合五月天| 国产伦精品一区二区三区四区免费| 久久久久久一区| 亚洲乱码国产一区三区| 精品日韩欧美| y97精品国产97久久久久久| 亚洲高清资源综合久久精品 | 久久精品国产一区二区三区不卡| 欧美美最猛性xxxxxx| 日韩视频专区| www国产无套内射com| 国产精品久久久久久久久久久久| 日韩 欧美 自拍| 国产精品一区二区三区免费 | 日韩av一级大片| av动漫在线看| 国产精品美女主播| 日韩人妻一区二区三区蜜桃视频| av一区二区三区免费观看|