Not logged in. Log in with GitHub. About Websheets.

List of all available Websheets


Viewing cpp/cs103/hw-functions/even by daveagp@gmail.com. You have unsaved changes. Log in above to create, edit, preview and publish Websheets.
PropertyValue
Description
html markup
shown to student
 
Define a function <tt>is_even</tt> that takes an integer argument
<tt>x</tt>, and returns the <tt>bool</tt> value <tt>true</tt> when
<tt>x</tt> is even, and <tt>false</tt> otherwise.
<p>
<b>Note: don't use <tt>cout</tt></b> in your code. 
Just <tt>return</tt> the appropriate value. The grader will 
automatically add print statements as it sees fit.
Engine
Template / Reference solution
 
#include <iostream>
using namespace std;
\[
REDACTED
]\
C++ test suite
See manual
 
[
   ["check-function", "is_even", "bool", ["int"]],
   ["call-function", "is_even", ["11"]],
   ["call-function", "is_even", ["4"]],
   ["call-function", "is_even", ["103"]],
   ["call-function", "is_even", ["52"]]
]


Optional properties:

Note: problems are open-source by default (see 'Public permissions'). Assumed license for open problems is Creative Commons 4.0 Attribution-ShareAlike unless specified in 'Remarks'.