This is C++. I would like to know the TODO list comments. #include <cstdlib> #in
ID: 3793082 • Letter: T
Question
This is C++. I would like to know the TODO list comments.
#include <cstdlib>
#include <iostream>
// TODO: 2. (1 point) Declare your Acker function prototype below:
// When done, commit with the commit message that follows, being
// sure to delete all these TODO instructions before actuallly
// executing the git commit command.
//
// CSC232-HW02 - Added Aker function prototype.
//
// Don't forget to fully document the function prototype using
// all the appropriate doxygen elements.
/**
* @brief Entry point to this application.
* @remark You are encouraged to modify this file as you see fit to gain
* practice in using objects.
*
* @param argc the number of command line arguments
* @param argv an array of the command line arguments
* @return EXIT_SUCCESS upon successful completion
*/
int main(int argc, char **argv) {
// TODO: 4. (0.5 points) Replace *** text *** with actual call to Acker
// function. When done, commit with the commit message that follows,
// being sure to delete all these TODO instructions before actuallly
// executing the git commit command.
//
// CSC232-HW02 - Display calculated Acker value.
//
std::cout << "Acker(1, 2) = " << "*** replace me with call to Acker***"
<< std::endl;
return EXIT_SUCCESS;
}
// TODO: 3. (2 points) Define the Acker recursive function below. When done,
// commit with the commit message that follows, being sure to delete
// all these TODO instructions before actually executing the git
// commit command.
//
// CSC232-HW02 - Implemented Acker function.
// TODO: 5. (1 point) Do a box trace of Acker(1, 2) using pen and paper.
// Hand this in at the beginning of class on Friday, 17 February 2017.
// Your solution MUST be legible; no points are assigned to illegible
// papers.
This is testRunner.
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
#include <cppunit/Test.h>
#include <cppunit/TestFailure.h>
#include <cppunit/portability/Stream.h>
/**
* @brief Main test driver for CPPUNIT test suite.
* @remark DO NOT MODIFY THE SPECIFICATION OR IMPLEMENTATION OF THIS CLASS! ANY
* MODIFICATION TO THIS CLASS WILL RESULT IN A GRADE OF 0 FOR THIS LAB!
*/
class ProgressListener : public CPPUNIT_NS::TestListener {
public:
ProgressListener()
: m_lastTestFailed(false) {
}
~ProgressListener() {
}
void startTest(CPPUNIT_NS::Test *test) {
CPPUNIT_NS::stdCOut() << test->getName();
CPPUNIT_NS::stdCOut() << " ";
CPPUNIT_NS::stdCOut().flush();
m_lastTestFailed = false;
}
void addFailure(const CPPUNIT_NS::TestFailure &failure) {
CPPUNIT_NS::stdCOut() << " : " << (failure.isError() ? "error" : "assertion");
m_lastTestFailed = true;
}
void endTest(CPPUNIT_NS::Test *test) {
if (!m_lastTestFailed)
CPPUNIT_NS::stdCOut() << " : OK";
CPPUNIT_NS::stdCOut() << " ";
}
private:
/// Prevents the use of the copy constructor.
ProgressListener(const ProgressListener ©);
/// Prevents the use of the copy operator.
void operator=(const ProgressListener ©);
private:
bool m_lastTestFailed;
};
int main() {
// Create the event manager and test controller
CPPUNIT_NS::TestResult controller;
// Add a listener that colllects test result
CPPUNIT_NS::TestResultCollector result;
controller.addListener(&result);
// Add a listener that print dots as test run.
ProgressListener progress;
controller.addListener(&progress);
// Add the top suite to the test runner
CPPUNIT_NS::TestRunner runner;
runner.addTest(CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest());
runner.run(controller);
// Print test in a compiler compatible format.
CPPUNIT_NS::CompilerOutputter outputter(&result, CPPUNIT_NS::stdCOut());
outputter.write();
return result.wasSuccessful() ? 0 : 1;
}
Explanation / Answer
// The following C# code file contains several TODO reminders. // Note that each line task reminder begins, like this comment, // with the C# comment indicator, '//'. // TODO: Add standard code header comment here. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Windows.Forms; // TODO: Add references to specific resources here. namespace TodoExample { partial class TodoExample : Form { public TodoExample() { InitializeComponent(); } } } // TODO: It is even possible to add comments at the end.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.