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

List of all available Websheets


Viewing cpp/arrays/alphabet2 by redekopp@usc.edu. You have unsaved changes. Log in above to create, edit, preview and publish Websheets.
PropertyValue
Description
html markup
shown to student
 
<p>Write code to fill a blank character array with the lower-case letters of the alphabet repeated twice <br>
   (i.e. <tt>abcdefg...wxyzabcdefg...wxyz</tt></p>
<p>Output the array to the screen as a C-string by terminating it with a null character and using <tt>cout</tt> to print
   the entire string at once rather than printing it character by character</p>
Remarks
Comments, history, license, etc.
 
Copied from problem cpp/arrays/sorted (author: redekopp@usc.edu)
Copied from problem cpp/arrays/fibonacci (author: redekopp@usc.edu)
Copied from problem cpp/arrays/reverse (author: redekopp@usc.edu)
Copied from problem cpp/cs103/hw-arrays/reverse_copy (author: redekopp@usc.edu)
remove
Engine
Template / Reference solution
 
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
int main() {
   const int SIZE = \[ REDACTED ]\;
   char alpha[SIZE]; // Appropriate size
   // Fill in the string (character array)
\[
REDACTED
]\
   // Print out the C-string 
   cout << \[ REDACTED ]\ << endl;
   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 [{}]
 
[
   {"stdin": ""}
   
]


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