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

List of all available Websheets


Viewing cpp/cs103/hw-variables/seconds 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
 
Debug this program so that it prints out the number of seconds in a week.
Engine
Template / Reference solution
 
#include <iostream>
using namespace std;
/* prints out the number of seconds in a week */
int main() {
\[
REDACTED
\show:
   int seconds_per_minute = 60;
   int seconds_per_hour = seconds_per_minute * 50; // TODO: check this!
   int seconds_per_day = seconds_per_hour * 24;
   int days_per_week = 5;
   // days_per_week = days_per_week + 2; // weekends are disabled!?
   cout << seconds_per_day * days_per_week;
   return 0;
]\
}
C++ test suite
json list of stdin/args tests
e.g. [{"stdin":"hi", "args":["4", "5"]},
{"stdin":"noargs"}]

to just run once with no input use [{}]
 
[
   {}
]


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'.