Presentation is loading. Please wait.

Presentation is loading. Please wait.

HW9(100pts) The homework Due on May 26, 23:59:59 請注意:本次作業開始,請將所有的檔案從gitlab刪除,只留下當 次的作業。例如本次作業應該只需要以下檔案上傳至Gitlab。 HW9請沿用HW8的algorithm.h檔案.

Similar presentations


Presentation on theme: "HW9(100pts) The homework Due on May 26, 23:59:59 請注意:本次作業開始,請將所有的檔案從gitlab刪除,只留下當 次的作業。例如本次作業應該只需要以下檔案上傳至Gitlab。 HW9請沿用HW8的algorithm.h檔案."— Presentation transcript:

1 HW9(100pts) The homework Due on May 26, 23:59:59 請注意:本次作業開始,請將所有的檔案從gitlab刪除,只留下當 次的作業。例如本次作業應該只需要以下檔案上傳至Gitlab。 HW9請沿用HW8的algorithm.h檔案

2 Part 1.(10pts) Rewrite your code into template method
Please rewrite your function “for_each”, ”all_of” into template method. You can rename class Type and class yourClass

3 Part 2.(10pts) Create new function remove()
Please implement a new function “remove” in algorithm.h . remove: you choose a removeValue, and the remove function will find all the values that match removeValue in your vector and remove them. For example: given vector [ ], remove 20, the result is [10 30]

4 Part 3.(20pts)Design UI In main.cpp, you need to design an UI that user can choose which function to execute. The control flow will look like below. 1. main UI 2.choose 1 and input an integer into vector.

5 3.(assume that the vector is [20 10 20 20 30 20]) choose 2 to show the vector
4.choose 3 and give an operator to calculate with value 2, then choose 2 to show the result.

6 5. choose 4 and input 22 to remove 22 in your vector, choose 2 to show the result
6.choose 5 to clean the vector, and choose 2 to show the result. 7.choose 6 to exit the program

7 Part4.(40pts) Unit Test We wrote 13 UT to test your algorithm.h The test data will not be announced. You have to make all of them pass. You know this by checking Reports on Jenkins.

8 Part5.(20pts) Acceptance Test
We wrote 7 AT to test your UI

9 Addition You can use the string here
When choose 2, the output will like this “ ”


Download ppt "HW9(100pts) The homework Due on May 26, 23:59:59 請注意:本次作業開始,請將所有的檔案從gitlab刪除,只留下當 次的作業。例如本次作業應該只需要以下檔案上傳至Gitlab。 HW9請沿用HW8的algorithm.h檔案."

Similar presentations


Ads by Google