99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

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

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信奧賽老師
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

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

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

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                日韩福利在线视频| 亚洲av成人精品日韩在线播放| 日韩精品久久久久久久的张开腿让| 中文字幕人妻一区二区| 国产午夜小视频| 天天综合在线视频| 国产无人区码熟妇毛片多| 一区二区视频观看| 国产又粗又猛视频| 性少妇bbw张开| 国产原创精品在线| 亚洲天堂手机在线| 日韩在线一卡二卡| 国产午夜精品久久久久久久久| 中文字幕影片免费在线观看| 青青操免费在线视频| www.久久久久久| 天天干,夜夜爽| 久草资源在线视频| 亚洲一区二区91| 天堂在线视频免费观看| 精品人妻无码一区二区三区蜜桃一 | 岛国精品一区二区三区| 午夜影院免费观看视频| 精品久久免费视频| 波多野结衣黄色| 亚洲精品成人区在线观看| 日本欧美www| 黄色工厂在线观看| 国产69精品久久久久久久久久| 中文字幕 人妻熟女| 人人妻人人澡人人爽精品日本| 国产午夜精品久久久久久久久| 亚洲精品网站在线| 亚洲福利精品视频| 日韩精品国产一区| 久久久久黄色片| 国产熟女一区二区| 肥臀熟女一区二区三区| 亚洲精品视频专区| 在线一区二区不卡| 无码人妻精品一区二区三区夜夜嗨| 精品国产av色一区二区深夜久久| av在线免费播放网址| 亚洲国产精彩视频| 一区二区三区影视| 姝姝窝人体www聚色窝| 免费国产黄色片| 精品人妻伦一区二区三区久久| 国产高清av片| www.日韩高清| 99超碰在线观看| 69夜色精品国产69乱| 亚洲一区二区三区无码久久| 在线观看国产中文字幕| 五月婷婷综合在线观看| 熟女人妻在线视频| 色噜噜一区二区三区| 日本黄色片在线播放| 欧美精品一二三四区| 久久久久久91亚洲精品中文字幕| 国产探花视频在线播放| 国产精品午夜福利| 国产精品黄色网| 国产三级在线观看完整版| 国产精品久久久久久久久久久久久久久久久 | 日本中文字幕精品—区二区| 久久久国产精华液| 伦av综合一区| 人妻少妇无码精品视频区| 欧美一级淫片免费视频黄| 人妻夜夜爽天天爽| 色噜噜日韩精品欧美一区二区| 日本高清一区二区视频| 色婷婷一区二区三区在线观看 | 99精品999| 波多野结衣av无码| 国产精品久久久久久免费免熟| 国产精品视频一区在线观看| 国产原创中文av| 免费看日批视频| 日韩欧美视频免费观看| 五月天激情婷婷| 做a视频在线观看| www.成人在线观看| 国产三级短视频| 免看一级a毛片一片成人不卡| 日韩欧美亚洲视频| 在线国产视频一区| 97超碰国产在线| 国产午夜精品理论片在线| 久久精品国产露脸对白| 色综合久久久久久| 中文字幕在线看人| 成人午夜免费在线观看| 国产又粗又猛又爽视频| 欧美激情久久久久久久| 无码精品人妻一区二区三区影院 | 久久精品视频6| 日本中文字幕免费| 亚洲国产成人va在线观看麻豆| av网站在线不卡| 久久久高清视频| 手机av在线看| 99国产精品免费| 精品人妻无码一区二区三区换脸| 色婷婷免费视频| 亚洲婷婷综合网| 黄色av小说在线观看| 日日夜夜精品免费| 亚洲专区第一页| 九九热只有精品| 一区二区三区福利视频| 国产成人三级在线播放 | 亚洲精品手机在线观看| 国产麻豆剧传媒精品国产| 日本va欧美va国产激情| 亚洲一区二区天堂| 久久综合亚洲色hezyo国产| 樱花草www在线| 国产毛片毛片毛片毛片| 日日噜噜噜噜人人爽亚洲精品| 69精品久久久| 欧美激情精品久久| 亚洲一区二区在线免费| 精品女同一区二区三区| 中文字幕一区二区久久人妻| 国产一区二区三区三州| 香蕉视频成人在线| 国产又黄又粗又猛又爽的视频| 婷婷免费在线观看| 国产一级片视频| 又色又爽又黄无遮挡的免费视频| 国产裸体永久免费无遮挡| 五月婷婷之婷婷| 黑人粗进入欧美aaaaa| 在线观看av大片| 久久精品久久国产| 一本到在线视频| 欧美一级片免费在线观看| 91黄色免费视频| 手机在线观看毛片| 国产一二三四区| 亚洲欧美高清在线| 欧美一区二区三区激情| 成人手机在线免费视频| 五月婷婷丁香综合网| 国精品人妻无码一区二区三区喝尿| 在线视频免费观看一区| 美女福利视频网| 丰满的亚洲女人毛茸茸| 伊人久久久久久久久| 女同毛片一区二区三区| 高清一区二区视频| 中文字幕乱码人妻二区三区| 男女一区二区三区| 国产成人精品亚洲男人的天堂| 午夜免费高清视频| 久久久久久久久久影院 | 又色又爽的视频| 欧美成人精品网站| 国产成年人视频网站| 中文字幕 欧美激情| 欧美亚洲另类小说| 国精产品久拍自产在线网站| 亚洲视频天天射| 午夜国产福利一区二区| 久久影视中文字幕| 国产精品一区二区人妻喷水| 亚洲一级免费观看| 亚洲av色香蕉一区二区三区| 久久久无码人妻精品无码| 国产黄色高清视频| 18国产免费视频| 中国一区二区视频| 神马久久精品综合| 欧美性生交xxxxx| 久久久久久久9999| 国产小视频在线看| aaa在线视频| 亚洲资源在线播放| 亚洲黄色精品视频| 性生交大片免费全黄| 日韩久久久久久久久久久| 久久久久中文字幕亚洲精品| 国产性xxxx| 国产亚洲精品久久777777| 成人免费视频国产免费观看| 中文字幕在线观看高清| 亚洲av熟女高潮一区二区| 特级丰满少妇一级| 日韩黄色中文字幕| 欧美三级午夜理伦三级富婆| 久草免费在线视频观看| 国产日韩视频一区| 国产欧美小视频| 国产污视频在线看| 国产一级伦理片| 精品国产午夜福利| 韩国av电影在线观看|