List of all available Websheets
Viewing cpp/sstreams/date by redekopp@usc.edu. You have unsaved changes. Log in above to create, edit, preview and publish Websheets.
Property | Value |
---|---|
Description html markup shown to student | Define a function <tt>date(string month, int day, int year)</tt> that returns a <tt>string</tt> combining the elements in this format: <pre>October 6, 1880</pre> |
Public permissions | |
Engine | |
Template / Reference solution |
using namespace std; string date(string month, int day, int year) { // return date in format like: October 6, 1880 \[ return "hi"; ]\ } int main() { string date1 = date("December", 30, 1950); cout << boolalpha; cout << "date1 OK? " << ("December 30, 1950" == date1) << endl; cout << date("July", 4, 1776) << endl; cout << date("October", 6, 1880) << endl; } |
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 [{}] | [ {} ] |
Solution visibility |
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'.