Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Programming C++ No working needed, just the letter answer. All questions needed.

ID: 3729995 • Letter: P

Question

Programming C++ No working needed, just the letter answer. All questions needed. Will give thumbs up for correct answers. A. Which of the following will attempt to open the file "output file.txt" stored in the string myfile using the ofstream outFS? Select one: a. ofstream.open("output file.txt"); b. outFS.open(myfile.c_strO): c. myfile.open(outFS); d. outFS.open(output file.txt); B. Which of the following defines a member function Printschedule of the class Schedule, retuming nothing, and having one int parameter named year? Select one: a. void Schedule.PrintSchedulelint year) ( Function code '/) b. void Schedule: PrintSchedule(int year) { /. Function code"/ } c. Schedule: :PrintSchedule(int year) (/ Function code'/) d. void Schedule->PrintSchedule(int year) / Function code) C. Which of the following calls the function Sum by passing in two timehm structs (t1 and t2) and storing the result in a timehm struct t3? Select one: a. t3 - timehm.Sum(t1, t2); b. t3-timehm->Sum(t1, 12); c. tirmehm = Sum(timehm, timehm); d. t3 Sum(t1, t2);

Explanation / Answer

Answer A) b. outFS.open(myfile.c_str());

Answer B) b. void Schedule::PrintSchedule(int year)

Reason: '::' this operator used.

Answer C) d. t3=Sum(t1.t2);


Answer D) b.Pet myPet(3);

Reason: In class parameter is of type string but here passing integer.

Answer E) d. None of the above.

Reason: There is no error in the code.