Syllabus Template CSC XXXXXXXXXX FINAL EXAM REVIEW XXXXXXXXXXSPRING 2020 TA PAGE 1 OF 13 1. Section, Date and Time: XXXXXXXXXXFull Name in CAPITAL LETTERS | SFSU ID 2. Final Exam (1 exam, 0 dropped):...

Hello, I am looking for someone who is an expert on c++ programming language and can do my final exam.This class is a programming methodology class and exam time is 8 am to 10 am tomorrow. which is 2 hours of exam time. I just uploaded the exam review, so you can see what kind of questions and coding tasks will be on the exam.


Syllabus Template CSC 340.03+.04+.05 FINAL EXAM REVIEW SPRING 2020 TA PAGE 1 OF 13 1. Section, Date and Time: Full Name in CAPITAL LETTERS | SFSU ID 2. Final Exam (1 exam, 0 dropped): 150 points __________________________________|__________________ 3. To prepare for this exam, please review all the related materials including WEEK 01-17 packages, slides, mock-up exam(s), reading assignments, in-class practices, sample programs posted in the File Manager, and assignments. 4. You do not need to print this exam. No paper. No handwriting. No scanning. Please type up all your answers in the answer space available provided in the exam. The provided exam will be in Microsoft Word format. Please submit a single PDF via iLearn. 5. All the rules of an actual final exam apply to this exam such as: closed books, closed notes, and no communication with anyone except the course instructor. The course instructor will be available on Zoom during the exam time: zoom.ducta.net 6. Please ask all your questions, if any, during the review sessions. Thank you. HONOR CODE: - Please follow CS Department’s policies: https://cs.sfsu.edu/student-policies PART A – 70 Points A.1 - 10 pts Please explain in detail Scott Meyers’s point: Use weak_ptr for shared_ptr like pointers that can dangle. Hint: a correct explanation should also discuss dangling raw pointer. Answer: please see README.txt and please discuss during our review sessions. Thank you. CSC 340.03+.04+.05 FINAL EXAM REVIEW SPRING 2020 TA PAGE 2 OF 13 A.2 - 10 pts In your understanding, why weak_ptr was not named strong_ptr? Please explain in detail how weak_ptr’s functions expired() and lock() work. Answer: please see README.txt and please discuss during our review sessions. Thank you. A.3 - 10 pts What is a class which contains a pure virtual function? Please code a definition of a pure virtual function. Answer: please see README.txt and please discuss during our review sessions. Thank you. CSC 340.03+.04+.05 FINAL EXAM REVIEW SPRING 2020 TA PAGE 3 OF 13 A.4 - 10 pts … int funcB(int); int funcA(int n) { if (n <= 1)="" return="" 1;="" else="" return="" n="" +="" funcb(n="" -="" 2);="" }="" int="" funcb(int="" n)="" {="" if="" (n=""><= 3)="" return="" 1;="" else="" return="" n="" *="" funca(n="" -="" 3);="" }="" int="" main()="" {="" int="" num="11;" cout="">< funca(num);="" return="" 0;="" }="" what="" is="" the="" output="" of="" this="" program?="" please="" show="" your="" work.="" answer:="" please="" see="" readme.txt="" and="" please="" discuss="" during="" our="" review="" sessions.="" thank="" you.="" csc="" 340.03+.04+.05="" final="" exam="" review="" spring="" 2020="" ta="" page="" 4="" of="" 13="" a.5="" -="" 10="" pts="" each="" lambda="" has="" 6="" parts.="" please="" name="" 5="" of="" them="" and="" check="" mark="" the="" optional="" parts.="" [="" ]="" p1:="" [="" ]="" p2:="" [="" ]="" p3:="" [="" ]="" p4:="" [="" ]="" p5:="" please="" write="" the="" shortest="" lambda:="" how="" is="" lambada’s="" reference="" capture="" different="" from="" value="" capture?="" what="" does="" lambda’s="" mutable="" do?="" answer:="" please="" see="" readme.txt="" and="" please="" discuss="" during="" our="" review="" sessions.="" thank="" you.="" csc="" 340.03+.04+.05="" final="" exam="" review="" spring="" 2020="" ta="" page="" 5="" of="" 13="" a.6="" -="" 10="" pts="" how="" does="" shell="" sort="" work?="" what="" are="" the="" steps?="" 9="" 5="" 3="" 2="" 6="" 8="" 3="" 7="" 4="" 0="" show="" the="" contents="" of="" the="" array="" above="" each="" time="" a="" shell="" sort="" changes="" it="" while="" sorting="" the="" array="" into="" ascending="" order.="" answer:="" please="" see="" readme.txt="" and="" please="" discuss="" during="" our="" review="" sessions.="" thank="" you.="" csc="" 340.03+.04+.05="" final="" exam="" review="" spring="" 2020="" ta="" page="" 6="" of="" 13="" a.7="" -="" 20="" points="" -="" memory="" area="" 1:="" environment="" -="" memory="" area="" 2:="" runtime="" stack="" -="" memory="" area="" 3:="" free-store="" -="" memory="" area="" 4a:="" uninitialized="" data="" -="" memory="" area="" 4b:="" initialized="" data="" -="" memory="" area="" 5:="" binary="" program="" #include=""> #include using namespace std; string model; class PC { public: PC() {}; static string pcModel; string name{ "Deep Blue" }; }; string PC::pcModel = "1996"; PC* testPC(string str) { shared_ptr uPcPtr { make_shared() }; static PC pc; PC* laptop = new PC(); return &pc; } function testLambda() { int price = 2000; int rank = 1; function pcLambda = [rank, &price]()->int { cout < "pclambda="" in="" testlambda"="">< endl;="" return="" price="" +="" rank;="" };="" return="" pclambda;="" }="" int="" main()="" {="" pc*="" pcptr="testPC("Gator");" string="" pcname{="" pcptr-="">name }; model = PC::pcModel; auto testLambdaPtr = testLambda(); cout < testlambdaptr()="">< endl; return 0; } a. in which memory area is this element stored? please circle your choice and explain why? b. the lifetime, beginning & end, of this element? why? csc 340.03+.04+.05 final exam review spring 2020 ta page 7 of 13 model [1] [2] [3] [4a] [4b] [5] why [area]? endl;="" return="" 0;="" }="" a.="" in="" which="" memory="" area="" is="" this="" element="" stored?="" please="" circle="" your="" choice="" and="" explain="" why?="" b.="" the="" lifetime,="" beginning="" &="" end,="" of="" this="" element?="" why?="" csc="" 340.03+.04+.05="" final="" exam="" review="" spring="" 2020="" ta="" page="" 7="" of="" 13="" model="" [1]="" [2]="" [3]="" [4a]="" [4b]="" [5]="" why="">
May 18, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here