辅导ECS 34程序、 写作c++编程

” 辅导ECS 34程序、 写作c++编程ECS 34: Programming Assignment #7Fall 2020Contents1 Changelog 12 General Submission Details 13 Grading Breakdown 14 Submitting on Gradescope 24.1 Regarding Autograder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Your Programming Tasks 25.1 Part #1: Copy to Multiple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25.2 Part #2: Run Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35.3 Part #3: Templated Linked List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 ChangelogYou should always refer to the latest version of this document. v.1: Initial version.2 General Submission DetailsPartnering on this assignment is prohibited. If you have not already, you should read the section onacademic Misconduct in the syllabus.This assignment is due the night of Tuesday, December 15. Gradescope will say 12:30 AM on Wednesday, December 16,due to the grace period (as described in the syllabus). Be careful about relying on the grace period for extra time; this couldbe risky.You should use the -Wall, -Werror, and -std=c++11 flags when compiling. The autograder will use these flags when itcompiles your code.3 Grading BreakdownAs stated in the syllabus, this assignment is worth 4% of the final grade. Below is the breakdown of each part. Part #1: 2% (20 points) Part #2: 2% (20 points) Part #3: 5% (50 points)Note on extra credit: I will set the points cutoff at 40 points, which means that it is possible to earn extra credit onthis assignment. 1This content is protected and may not be shared, uploaded, or distributed.1If, due to unique circumstances that we discussed over email, the worth of programming assignment #7 is scaled up to be worth more than4% of your final grade, the extra credit will not scale, i.e. you cannot earn more extra credit than other students.14 Submitting on GradescopeYou should only submit list.hpp, list.inl, and the two shell scripts. You have infinite submissions until the deadline.During the 10/02 lecture, I talked about how to change the active submission, just in case that is something that youfind yourself wanting to do.4.1 Regarding AutograderYour output must match mine exactly.There is a Description about how to interpret some of the autograder error messages in the directions for the first twoprogramming assignments. I will not repeat that description here.5 Your Programming Tasks5.1 Part #1: Copy to MultipleFilename: cp_mult.shMotivation: Recall that the cp command can be used to copy multiple files into a destination directory, but it cannot beused to copy one file into multiple destinations. You will write a script that does that.Write a shell script that takes as argument a regular file (i.e. never a directory) and a list of destinations. The scriptshould copy the file into each of the given destinations. If not enough arguments are provided, then a usage message shouldbe printed and the script should return 1 (with exit 1); otherwise, the script should return 0. Note that just like cp, cp_mult.shcan be Used to make multiple copies of a file in the same directory.Below are some examples of how your script should behave.21 Usage : ./ cp_mult . sh [ src ] [ dest1 ] …22 $ echo $?23 124 $ ./ cp_mult . sh vals . txt25 Usage : ./ cp_mult . sh [ src ] [ dest1 ] …26 $ ls *. txt27 vals . txt28 $ ./ cp_mult . sh vals . txt vals2 . txt vals3 . txt vals4 . txt29 $ cat vals2 . txt5.2 Part #2: Run StepsFilename: run_steps.shMotivation: As a happy undergraduate student, I encountered several situations in which I had to run an executablemultiple times with different command-line arguments and collect the output of each of those runs. As you can hopefullyimagine, doing this manually (i.e. typing each line into the terminal) would have been annoying; you can save time on sucha task by writing a script like the one you will write for this part.Write a script that takes five arguments: A command to run (which could be an executable compiled with gcc). Note that it must be the exact command neededto run it, not just the executables name (which is why you see ./test in the example instead of test). A start integer A. An end integer B. A step integer S. An output file.The script Should perform a series of runs of the given command. The first run should have A be passed as argument tothe command to run. In the next run, A + S should be passed. After that, A + 2S, then A + 3S, then A + 4S, and so on,until the value passed would exceed B. Each runs results should be logged into the output file. You may not assume thisoutput file exists, and its old contents should be overwritten.The script assumes that the executable only takes an integer as its only command-line argument. If not enough argumentsare provided, Then a usage message should be printed and the script should return 1 (with exit 1); otherwise, the script shouldreturn 0.Below are some examples of how your script should behave.1 $ cat test .c2 # include stdio .h 34 int main ( int argc , char * argv [])5 {6 printf ( Provided : %s \n, argv [1]) ;7 }8 $ gcc – Wall – Werror test . c -o test9 $ ./ run_steps . sh ./ test 10 100 5 output1 . txt10 $ cat output1 . txt11 === 10 ===12 Provided : 1013 === 15 ===14 Provided : 1515 === 20 ===16 Provided : 2017 === 25 ===18 Provided : 2519 === 30 ===20 Provided : 3021 === 35 ===22 Provided : 3523 === 40 ===24 Provided : 4025 === 45 ===26 Provided : 4527 === 50 ===28 Provided : 5029 === 55 ===30 Provided : 5531 === 60 ===32 Provided : 6033 === 65 ===34 Provided : 6535 === 70 ===36 Provided : 7037 === 75 ===38 Provided : 7539 === 80 ===40 Provided : 8041 === 85 ===342 Provided : 8543 === 90 ===44 Provided : 9045 === 95 ===46 Provided : 9547 === 100 ===48 Provided : 10049 $ ./ run_steps . sh ./ test 50 80 10 output2 . txt50 $ cat output2 . txt51 === 50 ===52 Provided : 5053 === 60 ===54 Provided : 6055 === 70 ===56 Provided : 7057 === 80 ===58 Provided : 8059 $ cat test2 .c60 # include stdio .h 61 # include stdlib .h 6263 int main ( int argc , char * argv [])64 {65 int num = atoi ( argv [1]) ;66 if ( num 100)67 printf ( Less than 100.\ n ) ;68 else69 printf ( Greater than or equal to 100.\ n ) ;70 }71 $ gcc – Wall – Werror test2 .c -o test272 $ ./ run_steps . sh ./ test2 97 104 2 output3 . txt73 $ echo $?74 075 $ cat output3 . txt76 === 97 ===77 Less than 100.78 === 99 ===79 Less than 100.80 === 101 ===81 Greater than or equal to 100.82 === 103 ===83 Greater than or equal to 100.84 $ ./ run_steps . sh ./ test2 97 10485 Usage : ./ run_steps . sh [ executable ] [ start ] [ end ] [ step ] [ outfile ]86 $ echo $?87 188 $5.3 Part #3: Templated Linked ListFilenames: list.hpp and list.inlLook at the files list.hpp and list.inl that are Provided on Canvas. These files contain the incomplete definition of atemplated linked list. You are to implement this class methods. In the header file, I describe what each method is supposedto.You are not allowed to use smart pointers in this assignment. (We will talk about these in slide deck #13.)Manual review: I will do a quick manual review of your submission after the deadline in order to check that you obeythe time complexity constraints (where applicable), that you do not use smart pointers, and that you do not have publicmember variables in class List.Suggestions/tips: Recommended order of Completion: I would probably start with the constructor, pushFront(), pushBack(), andoperator. I would consider the copy constructor, copy assignment operator, and destructor to be the hardest parts. Required concepts: If you understand operator overloading, templates, and copy semantics well, then I would thinkthat this assignment should be comparable to programming assignment #5 (class UnweightedGraph) in difficulty, so makesure to start by understanding the recent concepts. list.hpp vs. list.inl: Because list.inl is included in list.hpp, it isnt important which functions you choose to define inlist.hpp vs. list.inl. I would recommend avoiding defining all of the required methods in one or the other; I think youshould get used to the syntax for both defining a method within the class (in list.hpp) and defining a method outside4the class (in list.inl). For operator, it did not seem that I could define it outside of class List, as the compiler seemsto put additional restrictions on a friend of a templated class; I could not find a workaround, but maybe there is one. Avoid duplicating code where possible: Certain methods and/or operators are so similar (e.g. pushBack() andoperator+=) that, probably, you should have one of them call the other. Template compiler error messages: If you ask any C++ programmer what the worst part of the language is, theywill likely say its the Compiler error messages that you get when dealing with templates. The slightest mistake in dealingwith templates can generate a huge number of error messages, and this can occur even when youre not explicitly usingtemplates (e.g. when youre using std::string, which is a typedef for the templated class std::basic_stringchar). As isusually the case, you want to start looking at the first error message (in case that one causes all of the other ones), butthis requires some scrolling. An alternative that Ive sometimes found helpful is to do the command g++ … 21 | head,where 21 redirects the standard error (the compiler error messages) of the g++ command to standard output so thatit can be pipelined into head. Initializer list error messages: If a compiler error is generated by one of your constructor initializer lists, thecompiler (at least, g++) will flag the last line that the initializer list reaches. This only matters if you spread theinitializer list across multiple lines like I tend to, but its something to be aware of, because it can be deceiving if thecause of the error has to do with something Towards the beginning of the initializer list instead of the end.Below are examples of how your code should behave. You can find main.cpp on Canvas.如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导