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

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

COS110代做、代寫C/C++設計程序

時間:2024-08-22  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



Department of Computer Science
Faculty of Engineering, Built Environment & IT
University of Pretoria
COS110 - Program Design: Introduction
Practical 4 Speciffcations
Release Date: 19-08-2024 at 06:00
Due Date: 23-08-2024 at 23:59
Total Marks: 150
1Contents
1 General Instructions 3
2 Overview 3
3 Background 3
4 Your Task: 4
4.1 Colour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4.1.1 Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4.1.2 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4.2 Mixer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.2.1 Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.2.2 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5 Testing 9
6 Implementation Details 10
7 Upload Checklist 10
8 Submission 11
9 Accessibility 11
21 General Instructions
• Read the entire assignment thoroughly before you start coding.
• This assignment should be completed individually, no group effort is allowed.
• To prevent plagiarism, every submission will be inspected with the help of dedicated
 software.
• Be ready to upload your assignment well before the deadline, as no extension will be
granted.
• If your code does not compile, you will be awarded a mark of 0. The output of your program
will be primarily considered for marks, although internal structure may also be tested (eg. the
presence/absence of certain functions or classes).
• Failure of your program to successfully exit will result in a mark of 0.
• Note that plagiarism is considered a very serious offence. Plagiarism will not be tolerated, and
disciplinary action will be taken against offending students. Please refer to the University of
Pretoria’s plagiarism page at https://portal.cs.up.ac.za/files/departmental-guide/.
• Unless otherwise stated, the usage of c++11 or additional libraries outside of those indicated
in the assignment, will not be allowed. Some of the appropriate ffles that you have submit will
be overwritten during marking to ensure compliance to these requirements. Please ensure
you use c++98
• All functions should be implemented in the corresponding cpp ffle. No inline implementation
in the header ffle apart from the provided functions.
• The usage of ChatGPT and other AI-Related software is strictly forbidden and will be considered
 as plagiarism.
• Note, UML notation for variable and function signatures are used in this assignment.
2 Overview
Operator overloading in C++ allows you to deffne custom behaviors for operators when applied
to user-deffned types, enhancing code readability and ffexibility. This enhances the ffexibility and
readability of your code. In this practical you will simulate colours being mixed, to better your
understanding of operator overloading in C++.
3 Background
The RGB colour model is an additive colour model in which the red, green and blue primary colours
of light are added together in various ways to reproduce a broad array of colours. Each of the values
3are an integer between 0 and 255. In this practical you will implement a Colour class and a Mixer
class to simulate how the RGB values of colours are used to produce new colours.
4 Your Task:
You are required to implement the following class diagram illustrated in Figure 1. Pay close attention
to the function signatures as the h ffles will be overwritten, thus failure to comply with the UML,
will result in a mark of 0.
Figure 1: Class diagrams
Note, the importance of the arrows between the classes are not important for COS 110 and will
be expanded on in COS 214.
44.1 Colour
The colour class represents a colour with RGB values and have methods to change the RGB values.
4.1.1 Members
• -red: int
– This member variable contains the red value of the colour.
• -green: int
– This member variable contains the green value of the colour.
• -blue: int
– This member variable contains the blue value of the colour.
4.1.2 Functions
• +Colour(red : int = 0, green : int = 0, blue : int = 0)
– This is the constructor for the Colour class.
– It should assign the passed in red, green and blue values to the corresponding member
variables.
• +∼Colour()
– This is the destructor for the Colour class.
– There is no dynamic memory to deallocate, therefore it can be left blank.
• +getRed() : int
– This is a get method for the red member variable.
– It should return the red member variable.
• +getGreen() : int
– This is a get method for the green member variable.
– It should return the green member variable.
• +getBlue() : int
– This is a get method for the blue member variable.
– It should return the blue member variable.
• +operator+(other : const Colour&) : Colour
– This is a method used to combine the RGB values of two colours.
5– It should return a new colour where the RGB values are obtained using the following
formula: value+otherV alue
2
.
• +operator-(other : const Colour&) : Colour
– This is a method used to combine the RGB values of two colours.
– It should return a new colour where the RGB values are obtained using the following
formula: |value−otherV alue|
2
.
• +operator+=(other : const Colour&) : Colour&
– This is a method used to update the RGB values of a single colour by mixing it with
another colour.
– It should add the result of the following formula to the current RGB values of the colour:
value+otherV alue
2
.
– It is important that if one of the RGB values exceed 255 that it should be set to 255.
• +operator-=(other : const Colour&) : Colour&
– This is a method used to update the RGB values of a single colour by mixing it with
another colour.
– It should subtract the result of the following formula to the current RGB values of the
colour: |value−otherV alue|
2
.
• +operator*(ratio : double) : Colour
– This is a method used to create a new colour by multiplying the RGB values of a single
colour with a ratio.
– It is important that if one of the RGB values exceed 255 that it should be set to 255.
• +operator==(rhs : const Colour&) : bool
– This is a method used to return true if the RGB values of to colours are equal.
– It should return false if not.
4.2 Mixer
The mixer class simulates a paint palette, that is used by painters to mix colours.
4.2.1 Members
• -palette: Colour[10]
– This member variable that contains the different colours on the palette.
– It is an array of colours with a fixed size of 10.
– Each index of the array correspond to a colour on the palette.
64.2.2 Functions
• +Mixer(red : int, green : int, blue : int)
– This is the constructor for the Mixer class.
– It takes three integer parameter, that represent the RGB values of a default colour for the
colour palette.
– It populates the palette array.
– The colours in the palette at an even index should be initialised to white (All of the RGB
values must be 255).
– The colours in the palette at an odd index should be initialised to a colour with the passed
in RGB values.
• +∼Mixer()
– This is the destructor for the Mixer class.
– There is no dynamic memory to deallocate, therefore it can be left blank.
• +getPalette() : Colour *
– This is the get method for the palette member variable.
– It should return the palette array.
• +addColour(index : int, colourToAdd : const Colour&) : bool
– This method is used to add a colour to the specified index of the palette.
– If the colour at that index is white, it should be set to the passed in colour (colourToAdd).
– If the colour it not white, the operator+= of the colour class should be used to mix the
colour at the specified index with the passed in colour.
– Remember to check if the passed in index is valid.
– If the operation was succesful it should return true and false otherwise.
• +getColour(index : int) : Colour
– This method is used to get the colour at the specified index of the palette.
– Remember to check if the passed in index is valid.
– If it is, the colour at that index should be returned.
– If it is not, a ”special” invalid colour should be returned with all the RGB values equal to
-1.
• +displayPalette() : string
– This method is used to display each of the colours of the palette.
– It should return a string of the following format:
7Colour index : Red : red Green : green Blue : blue 1
– At the end of each colour, a newline should be added.
– The index, is the index of the colour in the palette.
– red, green and blue correspond to the member variables of the Colour class.
• +mixTwo(colour1 : int, colour2 : int) : bool
– This method is used to mix the two colours at the specified indexes using the operator+
and operator- of the colour class.
– The colour at the colour1 index should be set to that colour + the colour at the colour2
index.
– The colour at the colour2 index should be set to that colour - the newly set colour at the
colour1 index.
– Remember to check if the passed in indexes are valid. If not it should return false.
– If the operation was successful, it should return true.
• +mixRatio(colour : int, ratio : double) : bool
– This method is used to adjust the colour at the specified index by the specified ratio.
– It should make use of the operator* of the Colour class.
– The current colour’s RGB values at the colour1 index should be updated to that colour *
ratio.
– Remember to check if the passed in index is valid. If not it should return false.
– If the operation was successful, it should return true.
• +operator+=(coloursToMix : const Colour[10]) : Mixer&
– This method is used to mix the colours of the palette with the passed in colours.
– Each colour of the passed in array should be mixed with the colour at the corresponding
index of the colour palette.
– The += operator should be used to update each colour of the palette.
• +operator+(other : const Mixer) : Mixer&
– This method is used to combine the colour palettes of two mixers.
– Each colour at an even index should be set to that colour + the corresponding colour of
the other mixer.
– Each colour at an odd index should be set to that colour - the corresponding colour of the
other mixer.
• +operator*=(ratio : double) : Mixer&
8– This method is used to adjust all the colours in the palette by the specified ratio.
– It should make use of the operator* of the Colour class.
– The current colour’s RGB values should be updated to that colour * ratio.
5 Testing
As testing is a vital skill that all software developers need to know and be able to perform daily, 10%
of the assignment marks will be allocated to your testing skills. To do this, you will need to submit
a testing main (inside the main.cpp file) that will be used to test an Instructor Provided solution.
You may add any helper functions to the main.cpp file to aid your testing. In order to determine
the coverage of your testing the gcov 1
tool, specifically the following version gcov (Debian 8.3.0-6)
8.3.0, will be used. The following set of commands will be used to run gcov:
g ++ -- coverage *. cpp -o main 1
./ main 2
gcov -f -m -r -j $ { files } 3
This will generate output which we will use to determine your testing coverage. The following
coverage ratio will be used:
number of lines executed
number of source code lines
We will scale this ration based on class size.
The mark you will receive for the testing coverage task is determined using Table 1:
Coverage ratio range % of testing mark
0%-5% 0%
5%-20% 20%
20%-40% 40%
40%-60% 60%
60%-80% 80%
80%-100% 100%
Table 1: Mark assignment for testing
Note the top boundary for the Coverage ratio range is not inclusive except for 100%. Also, note
that only the functions stipulated in this specification will be considered to determine your testing
mark. Remember that your main will be testing the Instructor Provided code and as such, it can
only be assumed that the functions outlined in this specification are defined and implemented.
As you will be receiving marks for your testing main, we will also be doing plagiarism
checks on your testing main.
1For more information on gcov please see https://gcc.gnu.org/onlinedocs/gcc/Gcov.html
96 Implementation Details
• You must implement the functions in the header files exactly as stipulated in this specification.
Failure to do so will result in compilation errors on FitchFork.
• You may only use c++98.
• You may only utilize the specified libraries. Failure to do so will result in compilation errors
on FitchFork.
• Do not include using namespace std in any of the files.
• You may only use the following libraries:
– string
– cmath
– sstream
– iostream
• You are supplied with a trivial main demonstrating the basic functionality of this assessment.
7 Upload Checklist
The following c++ files should be in a zip archive named uXXXXXXXX.zip where XXXXXXXX is
your student number:
• colour.h
• colour.cpp
• mixer.h
• mixer.cpp
• main.cpp
• Any textfiles used by your main.cpp
• testingFramework.h and testingFramework.cpp if you used these files.
The files should be in the root directory of your zip file. In other words, when you open your zip file
you should immediately see your files. They should not be inside another folder.
108 Submission
You need to submit your source files on the FitchFork website (https://ff.cs.up.ac.za/). All
methods need to be implemented (or at least stubbed) before submission. Your code should be able
to be compiled with the following command:
g ++ *. cpp -o main 1
and run with the following command:
./ main 1
Remember your h file will be overwritten, so ensure you do not alter the provided h files.
You have 10 submissions and your best mark will be your final mark. Upload your archive to
the Practical 2 slot on the FitchFork website. Submit your work before the deadline. No late
submissions will be accepted!
9 Accessibility
1 Show the class diagram of the two classes to be implemented in this practical:
• Colour
• Mixer
The member variables and functions are discussed in Section 4. The following relationships exists
between the Colour and Mixer class:
• Mixer has a relationship with Colour, because of the palette member variable.





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












 

掃一掃在手機打開當前頁
  • 上一篇:代寫COMP3702、代做Python編程語言
  • 下一篇:陽江市C++信奧陳老師 CSP-j/s信奧賽老師
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 豆包網頁版入口 破天一劍 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    国产乱子伦精品| 91精品美女在线| 久久一区二区三区欧美亚洲| 久久成人综合视频| 国内精品400部情侣激情| 久久福利电影| 日本一区二区三区免费看| 国产精品稀缺呦系列在线| 精品国产无码在线| 国产中文字幕91| 国产综合在线看| 高清无码视频直接看| 911国产网站尤物在线观看| 色综合久久天天综线观看| 国产在线精品91| 久久久无码中文字幕久...| 欧美激情视频在线| 美女视频久久| 91久久国产精品91久久性色| 欧美激情一区二区久久久| 国产伦精品一区二区三区免费视频 | 97人人模人人爽人人喊38tv| 欧美精品成人91久久久久久久| 日本一区二区三区视频免费看| 欧美精品一区二区视频| 色偷偷88888欧美精品久久久| 久久av中文字幕| 免费一区二区三区| 久久亚洲免费| 日韩av播放器| 日韩在线播放视频| 红桃av在线播放| 免费av在线一区| 日韩成人av电影在线| 久久婷婷国产综合尤物精品| 日本高清视频精品| 国产成人精品在线视频| 蜜桃网站成人| 在线不卡视频一区二区| 久久综合伊人77777麻豆| 日韩女优在线播放| 久久不射电影网| 日韩暖暖在线视频| 日韩在线资源网| 国精产品一区一区三区视频| 真实国产乱子伦对白视频| 91精品国产乱码久久久久久久久| 久久亚洲精品网站| 国产精品亚洲美女av网站| 亚洲精品日韩在线观看| 国产精品 欧美在线| 欧美在线日韩在线| 欧美成人精品一区二区三区| 91久久精品日日躁夜夜躁国产| 久久成人亚洲精品| 欧美最猛性xxxxx亚洲精品| 国产精品久久久久久久久影视| 欧美亚洲另类在线一区二区三区| 久久综合九色综合88i| 欧美日韩国产综合在线| 欧美激情a在线| 久久精品网站视频| 国产呦系列欧美呦日韩呦| 亚洲二区自拍| 久久九九有精品国产23| 欧美日韩日本网| 欧美激情在线有限公司| 久久综合婷婷综合| 精品亚洲第一| 无码人妻精品一区二区蜜桃百度 | 三级三级久久三级久久18| 国产精品无码专区av在线播放| 秋霞成人午夜鲁丝一区二区三区| 国产黄色激情视频| 国产又粗又猛又爽又黄的网站| 国产精品久久国产| 91精品美女在线| 丁香六月激情网| 国产精品成人一区二区| 久久99精品久久久久子伦| 国产日韩亚洲欧美在线| 日本免费一级视频| 宅男一区二区三区| 久久天堂av综合合色| 久久久爽爽爽美女图片| 国产欧美韩日| 欧美精品亚洲| 日本午夜在线亚洲.国产| 91九色视频在线| 国内精品久久久久久影视8| 国产精品毛片a∨一区二区三区|国 | 成人福利网站在线观看| 国内精品久久久久影院优| 色中色综合成人| 欧美成人四级hd版| 国产精品中出一区二区三区| 秋霞在线一区二区| 亚洲国产精品久久久久婷婷老年| 久久免费少妇高潮久久精品99| 丁香六月激情网| 一区二区三区欧美在线| 91精品国产91久久久久久最新| 婷婷久久青草热一区二区| 欧美大肥婆大肥bbbbb| 深夜福利91大全| 国产亚洲欧美一区二区| 欧美亚洲丝袜| 日韩高清av| 日韩av色综合| 午夜老司机精品| 中文精品一区二区三区| 久久伊人资源站| 成人精品小视频| 日韩xxxx视频| 亚洲自拍中文字幕| 永久免费看av| 久久久精品网站| 国产成人成网站在线播放青青| 精品欧美一区二区三区久久久| 一区二区精品在线| 欧美日韩福利在线观看| 欧美成人亚洲成人日韩成人| 国产精品普通话| 国产精品老牛影院在线观看| 国产精品欧美一区二区| 久久天堂电影网| www精品久久| 国产精品永久在线| 日本成人黄色免费看| 无码aⅴ精品一区二区三区浪潮| 精品国产一区久久久| 日韩中文字幕免费| 久久精品一区中文字幕| 久久色在线播放| 国产精品久久不能| 久久riav| 日韩亚洲一区二区| 国产精品久久久久久亚洲调教 | 国产99视频精品免费视频36| 精品国产乱码久久久久久88av| 国产成人在线免费看| 国产成人一区二区三区小说| 色噜噜狠狠色综合网图区| 久久精品男人天堂| 久久伊人色综合| 久久99视频免费| 亚洲精品一区二| 日韩国产欧美亚洲| 美日韩免费视频| 97色在线观看免费视频| 久久国产精品视频在线观看| 国产精品视频自在线| 久久国产精品影片| 性色av香蕉一区二区| 欧美中文字幕视频在线观看| 亚洲在线一区二区| 亚洲精品免费网站| 日韩极品视频在线观看| 精品一区二区日本| 99国内精品久久久久久久软件| 国内自拍中文字幕| 福利视频一区二区三区四区| 久久男人av资源网站| 国产成人无码a区在线观看视频| 国产精品96久久久久久| 久久久久久久久一区二区| 国产精品久久久久久久免费大片| 日韩中文在线视频| 色中色综合影院手机版在线观看| 欧美成人一区二区三区电影| 一本色道久久综合亚洲精品婷婷| 精品国产乱码久久久久久丨区2区| 国产精品日韩在线播放| 欧美精品久久久久久久免费观看| 久久中文精品视频| 亚洲精品无人区| 欧美精品成人网| 91精品国产综合久久久久久丝袜| 成人久久精品视频| 日韩在线精品一区| 在线精品亚洲一区二区| 青青草国产精品一区二区| 国产精品自拍合集| 国产伦精品一区二区三区四区视频_ | 好吊色欧美一区二区三区四区| 欧美一区三区二区在线观看| 国产免费人做人爱午夜视频| 国产福利不卡| 日韩在线小视频| 日日骚久久av| 一区二区三区电影| 免费中文日韩| 久久人人看视频| 欧美日本精品在线| 久久久久国产精品免费| 热久久这里只有| 欧美a在线视频| 97久久国产亚洲精品超碰热| 国产精品美女久久久久av超清| 久久亚洲国产精品成人av秋霞|