91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区

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

代寫(xiě)CMPT 125、代做Computing Science

時(shí)間:2023-12-02  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



Assignment 4 CMPT 125 Intro. To Computing Science & Programming II Spring 2023
Page 1 of 6 © Victor Cheung, 2023
Assignment 4 (10% of Course Total)
Due date: 11:59pm, Dec 1 Dec 3, 2023
At least part of the assignment will be graded automatically. Make sure that your code compiles without
warnings/errors and produces the required output. Also use the file names and structures indicated as
requested. Deviation from that might result in 0 mark.
Your code MUST compile and run reasonably efficiently in the CSIL machines with the Makefile provided.
It is possible that even with warnings your code would compile. But this still indicates there is something
wrong with you code and you have to fix them, or marks will be deducted.
Your code MUST be readable and have reasonable documentation (comments) explaining what it does.
Use your own judgement, for example, no need to explain i += 2 is increasing i by 2, but explain how
variables are used to achieve something, what a certain loop is doing, and the purpose of each #include.
Description
There is only 1 question in this assignment. However, there are several files you need to submit. Write
your answer in the corresponding file as instructed along with your student information. While you still
can include any libraries that are covered in class, read the sections below to see how C++-compatible or
C++-specific versions should be used. You can also write your own helper functions. Only one of these files
should contain the main function.
Question 1 [16 marks]
In this question you are going to extend the program you made in Assignment 2&3 by providing more
functionalities. You are also again going to write your own main function so the program runs. In addition,
you are going to implement everything in C++.
Create a program that reads all the talk information from a file and provide an interface for the user to
query talk entries. Your program must support the following functionalities as options:
• Option 1: to load a talksfile – ask the user to input the name of the file containing talk information
and load the entries from that file (report # of entries). Note that the file can be non-existent (if
so the program should print the error and keep running with all subsequent choice of other option
asking the user to load a talks file), but if it exists you can assume the format inside that file is
consistent (duration, talk title, overview, ---), with each line having at most 300 characters. It is
possible for the user to load a different file by choosing this option again, which will replace the
previously loaded entries. You can assume the filename as at most 50 characters and has no space.
• Option 2: to list talks sorted by duration – list the talk entries from shortest to longest. If with the
same duration there are more than one talk entry, any order within that duration is acceptable.
• Option 3: to list talks sorted by title – list the talk entries sorted by title (as determined by strcmp).
If with the same title there are more than one talk entry, any order within that title is acceptable.
• Option 4: to lookup a talk – ask the user for a talk title for at most 50 characters (space included),
then report all entries containing the input as a substring. There can be more than one entry from
the file. The lookup is case-sensitive (i.e., “computer” and “Computer” are not the same).
o If one or more entries are found, print all the information. Any order is acceptable.
o If no entry is found, print “No such talk on record.”
Assignment 4 CMPT 125 Intro. To Computing Science & Programming II Spring 2023
Page 2 of 6 © Victor Cheung, 2023
You can assume the user will always enter at most 50 characters.
• Option 5: to add a talk – ask the user for all the information for a talk (duration, talk, overview)
and add it to the currently loaded entries. After adding, report and print “Entry added.”
o There is no need to check for duplicates. You can assume the input format is correct.
o Check for invalid duration: hours that are <0 and minutes/seconds that are <0 or >=60. If
that happens, inform the user and keep asking for a valid hours and minutes/seconds.
• Option 6: to save a talks file – ask the user to input the name of a file to which the current entries
will be saved in the same format as the sample files. It is possible for the name to be the same as
the file just being loaded. If so, it will be overwritten. Report # entries saved when done.
• Option 7: to terminate the program – thank the user and end the program.
Options **4&7 are basically the same as Assignment 3. Yet, there are also some differences. In particular,
since a vector is now used to store the talk entries, some functions that were defined in talklib previously
are now moved to better organize functions according to class definitions. Pay attention to the
provided .hpp files for details.
Your program must meet these requirements:
• Include the provided header file (.hpp file) and use the functions defined in the corresponding
implementation file (.cpp file) in your driver file (where main is), do not redefine those functions.
• Use the vector template in C++ (see https://www.programiz.com/cpp-programming/vectors) in
combination of the Talk struct defined in a4_talklib to store and handle the talk information. This
allows different numbers of talk entries and lets you practice using templates.
• Although C++ supports most of the operations in C, any operations we covered in the lecture
replacing C must be used. This includes: console I/O must be done by cin/cout (see iostream),
file I/O must be done by fin/fout (see fstream), text must be done by the string class, and
memory management must be done by new/delete.
• There must be no memory leaks (e.g., your program requests some memory but does not release
them all before it terminates). In CSIL you can use the Valgrind tool as described to check for that.
• Start with a fancy banner. There is no specific requirement besides it must include your name, 9-
digit SFU ID, and your SFU email address. Let your creativity shine, just nothing offensive.
• If a functionality (e.g., list, lookup) is requested by the user but no file has been loaded, the
program should print an error message telling the user that no talks file have been loaded and
prompt the user to do so.
• The sorting for Options 2&3 in Assignment 3 is done using the built-in qsort. Instead, use the builtin sort from C++ (see https://cplusplus.com/reference/algorithm/sort/).
*The entries are randomly generated using ChatGPT with a specific format and then lightly modified.
Hence, the content might not make sense and have very similar wording patterns – no need to worry.
And here are some hints for you to write your code:
• The interface is essentially a do-while loop where in each iteration it asks for an option and
determines what to do, with a repeating conditional of the terminating option has not been
inputted. It is a common approach for menu-based interfaces.
o Getting the user to input a valid input is exactly the same, with the repeating condition
being the input invalid (e.g., 0>userInput || userInput >=60).
Assignment 4 CMPT 125 Intro. To Computing Science & Programming II Spring 2023
Page 3 of 6 © Victor Cheung, 2023
• The built-in sort from C++ (defined in <algorithm>) can sort items in different kinds of container
classes as long as they provide access to the items using an “iterator”, which is a common design
pattern in Object-Oriented Programming. Refer to our lecture examples and the reference link
above for details. Also pay attention to how the compare function pointer works.
• The way things are being read from the console and file is simplified with cin and fin. Besides the
>> operator, there is a getline function for strings. Use it like this: getline(cin, stringVariable), or
this after an int is read: getline(cin >> ws, stringVariable). You are encouraged to explore why.
Here are some sample input and output (you can assume user input is always valid):
Figure 1. Choosing an option without opening any file then opening an existing file.
Figure 2. Listing talks sorted by duration (only showing the first 2 here for space).
Figure 3. Looking up a talk but no entries in the list.
Assignment 4 CMPT 125 Intro. To Computing Science & Programming II Spring 2023
Page 4 of 6 © Victor Cheung, 2023
Figure 4. Adding a talk to the list (it’s the shortest so Option 2 shows it first).
Figure 5. Saving the entries to a file (77 entries were loaded at start, adding 1 makes it 78).
Include the function definitions corresponding to a4_talklib.hpp (and your helper functions, if any) in a
source file named as a4_talklib.cpp. Do the same for a4_talkList. Both the .hpp files are provided to help
you get started. They are adequate to complete this assignment, but if you want you can add/remove
functions as appropriate – as long as they fulfill all the requirements stated above.
Include your main function (and your helper functions, if any) in another source file named as
a4_talkLookupSystem.cpp. We call this the driver file because this is where the program starts.
To determine where to place a helper function, think about its purpose. If it provides functionality with
the Talk structs (e.g., create/clear Talks, compare Talks), it is a library function; if it provides functionality
of the program (e.g., print a fancy banner), it is a program function; and if it provides functionality that
directly accesses private members of the talkList, it should be a member function of talkList. Incorrectly
placing these functions will lead to mark deductions in the Coding Style category.
Coding Style [4 marks]
Your program should be properly indented, have clear and meaningful variable names (e.g., no singleletter variable names except loop iterators) and enough white space and comments to make it easy to
read. Named constants should be used where appropriate. Each line of code should not exceed 80
characters. White space should be used in a consistent manner.
Assignment 4 CMPT 125 Intro. To Computing Science & Programming II Spring 2023
Page 5 of 6 © Victor Cheung, 2023
Keep your code concise and efficient. If your code is unnecessarily long or inefficient (e.g., hard-code for
all possible cases, extraneous function calls), we might deduct marks. To help you to get into the habit of
good coding style, we will read your code and marks will be deducted if your code is not styled properly.
Using the Makefile and Other Supplied Files
The Makefile provided in this assignment is used by a command in the CSIL machines called “make” to
quickly compile your code. It is especially useful if you have multiple source files. To use it, type the
following command in the prompt (make sure you are in the directory with all the files of Assignment 4):
$ make test1
The example above illustrates how Question 1 is compiled into an executable called “test1” when using
the Makefile. Replace the “test1” with “test2”, “test3”, …etc. for other questions. You can then run the
executable by typing “./test1” to test your code for Question 1. If you make changes to your code, use the
make command again. You can also use “make all” if you want to compile all your code at once.
The header files are there to make the compilation work. Take a look at them for information about how
each function should work. You might have to modify them and you will have to submit them this time.
Submission
Submit only the 5 source files (a4_talklib.hpp, a4_talklib.cpp, a4_talkList.hpp a4_talkList.cpp,
a4_talkLookupSystem.cpp) to CourSys. Refer to the corresponding Canvas assignment entry for details.
Assignment late penalty: 10% per calendar day (each 0 to 24 hour period past due), max 2 days late.
Academic Honesty
It is expected that within this course, the highest standards of academic integrity will be maintained, in
keeping with SFU’s Policy S10.01, “Code of Academic Integrity and Good Conduct.” In this class,
collaboration is encouraged for in-class exercises and the team components of the assignments, as well
as task preparation for group discussions. However, individual work should be completed by the person
who submits it. Any work that is independent work of the submitter should be clearly cited to make its
source clear. All referenced work in reports and presentations must be appropriately cited, to include
websites, as well as figures and graphs in presentations. If there are any questions whatsoever, feel free
to contact the course instructor about any possible grey areas.
Some examples of unacceptable behavior:
• Handing in assignments/exercises that are not 100% your own work (in design, implementation,
wording, etc.), without a clear/visible citation of the source.
• Using another student's work as a template or reference for completing your own work.
• Using any unpermitted resources during an exam.
• Looking at, or attempting to look at, another student's answer during an exam.
• Submitting work that has been submitted before, for any course at any institution.
All instances of academic dishonesty will be dealt with severely and according to SFU policy. This means
that Student Services will be notified, and they will record the dishonesty in the student's file. Students
Assignment 4 CMPT 125 Intro. To Computing Science & Programming II Spring 2023
Page 6 of 6 © Victor Cheung, 2023
are strongly encouraged to review SFU’s Code of Academic Integrity and Good Conduct (S10.01) available
online at: http://www.sfu.ca/policies/gazette/student/s10-01.html.
Use of ChatGPT or Other AI Tools
As mentioned in the class, we are aware of them. I see them as helpers/tutors from which you can look
for inspiration. However, these tools are not reliable and they tend to be overly confident about their
answers, sometimes even incorrect. It is also very easy to grow a reliance to them and put yourself at risk
of not actually learning anything and even committing academic dishonesty. Other issues include:
• When it comes to uncertainty, you won’t know how to determine what is correct.
• If you need to modify or fine tune your answer, you won’t know what to do.
• You will not be able to learn the materials and thus will not ne able to apply what you learn in
situations where no external help is available, for example, during exams and interviews.
For introductory level courses and less sophisticated questions, it is likely that you’ll get an almost perfect
answer from these tools. But keep in mind if you can get the answer, everyone can also get the answer.
Bottomline is, if you ask these tools to give you an answer and you use the answer as yours, you are
committing academic dishonesty by claiming work that is not done by you as yours.
Note that different instructors might have different policies regarding the use of these tools. Check with
them before you proceed with assignments from other courses.
請(qǐng)加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:CS3214代做、代寫(xiě)Java,C++程序語(yǔ)言
  • 下一篇:代做 COMP33 Modern Technologies程序語(yǔ)言代做
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評(píng)軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)/客戶要求/設(shè)計(jì)優(yōu)化
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    出評(píng) 開(kāi)團(tuán)工具
    出評(píng) 開(kāi)團(tuán)工具
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
  • 短信驗(yàn)證碼 目錄網(wǎng) 排行網(wǎng)

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

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

    91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区
    91国产成人在线| 中文字幕一区三区| 欧美日本精品一区二区三区| 欧美亚洲三区| 老司机精品久久| 在线视频一区二区三区| 久久欧美肥婆一二区| 日本乱码高清不卡字幕| 欧美性色黄大片| 8x福利精品第一导航| 精品免费99久久| 国产日韩精品久久久| 中文av一区特黄| 一区二区三区高清| 五月婷婷久久综合| 久久国产欧美日韩精品| 国产精品456| 91在线观看成人| 亚洲午夜激情| 久久欧美肥婆一二区| 欧美另类一区二区三区| 精品少妇一区二区三区在线播放 | 日本精品一区二区三区高清| 欧美日韩精品一区视频| 欧美精品一区二区在线观看| 国产精品乱人伦一区二区| 亚洲自拍欧美精品| 精品在线播放午夜| 欧美在线一二三区| 国产日韩欧美二区| 欧美人狂配大交3d怪物一区| 久久综合狠狠综合| 一区二区三区日韩欧美| 久久99久久久久| 午夜精品网站| 色乱码一区二区三区88| 日韩三级在线观看| 亚洲精品中文字幕乱码三区| 精品一区在线看| 欧美日韩免费精品| 在线观看欧美黄色| 国产偷国产偷亚洲高清人白洁| 亚洲五月六月丁香激情| 国产精品一二一区| 亚洲大胆在线| 91精品国产综合久久久久久久| 国产精品久久久久久久蜜臀| 免费看精品久久片| 欧美日韩国产在线一区| 欧美三级在线看| 亚洲免费观看高清完整版在线观看熊 | 欧美激情性爽国产精品17p| 久久激情一区| 欧美高清在线视频| 精品影视av免费| 国产欧美日韩| 久久这里只有精品6| 天涯成人国产亚洲精品一区av| a亚洲天堂av| 欧美亚洲国产一区二区三区| 亚洲三级理论片| 97精品电影院| 欧美日韩国产免费| 亚洲综合视频在线观看| av一区二区三区四区| 欧美性猛片aaaaaaa做受| 亚洲精品日产精品乱码不卡| 成人午夜av在线| 日本韩国精品在线| 亚洲美女在线一区| 欧美一区久久| 91精品国产色综合久久| 日本aⅴ亚洲精品中文乱码| 亚洲国产成人不卡| 国产午夜亚洲精品理论片色戒 | 国产成人午夜精品5599| 一本大道久久a久久精二百| 国产精品三级久久久久三级| 高潮精品一区videoshd| 欧美三级一区二区| 亚洲高清一区二区三区| 亚洲网站在线| 亚洲国产精华液网站w| 成人h动漫精品一区二区| 欧美日韩不卡一区| 免费观看日韩电影| 久久资源在线| 五月天丁香久久| 欧美亚洲免费| 亚洲国产婷婷综合在线精品| 亚洲人成久久| 亚洲婷婷国产精品电影人久久| 欧美精品综合| 中文字幕av不卡| 伊人婷婷久久| 一区二区三区免费在线观看| 亚洲午夜精品国产| 亚洲视频资源在线| 日韩亚洲精品在线| 一卡二卡欧美日韩| 国产精品入口66mio| 亚洲国产毛片aaaaa无费看| 国产精品丝袜xxxxxxx| 亚洲一二三四在线观看| 久久国产精品久久精品国产| 肉丝袜脚交视频一区二区| 久久精品卡一| 久久av老司机精品网站导航| 51久久夜色精品国产麻豆| 国产suv精品一区二区6| 精品蜜桃在线看| 午夜精品久久99蜜桃的功能介绍| 国产精品免费视频观看| 国产亚洲成人一区| 午夜精品成人在线| 欧美午夜精品久久久久久孕妇| 国模少妇一区二区三区| 日韩美女一区二区三区四区| 欧美不卡在线| 亚洲综合无码一区二区| 欧美影院一区二区三区| 成人永久aaa| 国产精品久久久久一区| 麻豆91精品| 精品午夜久久福利影院| 精品国产乱码久久久久久图片| 欧美一区在线看| 亚洲高清免费一级二级三级| 欧美亚洲综合久久| jizzjizzjizz欧美| 一区二区三区中文免费| 在线观看视频一区| av亚洲精华国产精华精华| 亚洲色欲色欲www在线观看| 一本久久综合亚洲鲁鲁五月天| 国产一区二三区| 国产精品嫩草99a| 91福利在线播放| 欧美人成在线| 蜜臀av一级做a爰片久久| 欧美精品一区二区三区蜜桃视频| 亚洲三级电影在线观看| 精品一区二区三区欧美| 国产精品区一区二区三| 欧美亚洲精品一区| 欧美一区二区三区在线免费观看 | 国产一区二区三区四| 国产精品久久久久久久裸模 | 亚洲精品久久久蜜桃| 欧美美女一区二区在线观看| 欧美日韩高清免费| 麻豆传媒一区二区三区| 国产午夜亚洲精品羞羞网站| 在线一区二区三区做爰视频网站| 欧美一区国产一区| 男女视频一区二区| 中文字幕av一区 二区| 欧美蜜桃一区二区三区| 99国产精品久久久久老师| 成人免费毛片app| 日韩精品视频网| 亚洲欧美怡红院| 精品成人在线观看| 欧美主播一区二区三区美女| 欧美午夜视频| 成人免费视频免费观看| 美女网站一区二区| 亚洲精品乱码久久久久久黑人| 欧美大片在线观看| 欧美一a一片一级一片| 国产乱码精品一区二区三区不卡| 99久久精品情趣| 国产精品亚洲午夜一区二区三区| 亚洲一区在线免费观看| 中文字幕av一区二区三区| 欧美一级欧美一级在线播放| 快she精品国产999| 中文一区二区| 欧美激情综合| 97久久超碰精品国产| 国产成人自拍高清视频在线免费播放| 亚洲成人激情av| 一区二区在线观看av| 专区另类欧美日韩| 欧美国产日本韩| 久久久精品综合| 久久综合色婷婷| 精品国产伦一区二区三区观看方式 | 最新不卡av在线| 国产欧美视频一区二区三区| 精品久久国产字幕高潮| 6080yy午夜一二三区久久| 欧美午夜寂寞影院| 欧美三级欧美一级| 色综合久久66| 在线观看不卡视频| 在线观看一区二区精品视频| 在线一区二区三区| 欧美日韩中文字幕精品| 欧美日韩亚洲丝袜制服|