Changes between Version 20 and Version 21 of ProgrammingPrompts


Ignore:
Timestamp:
Nov 26, 2015, 4:26:03 PM (9 years ago)
Author:
Timothy Lin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ProgrammingPrompts

    v20 v21  
    11= Programming Prompts
    2 The prompts are written with Java in mind, but can be adapted to most languages. The downloadable test scripts are run with Java, require the main class name to be the name of the prompt, and use the default package.
     2The prompts are written with Java in mind, but can be adapted to most languages. The downloadable starter code and test scripts are run with Java, require the main class name to be the name of the prompt, and use the default package.
    33
    44{{{
    55#!div style="border:1pt dotted;color:green"
    66Note: To use the starter code and test scripts at the '''bottom of the page''', download them to the directory of your choice, then in ''Eclipse'', right-click in the ''Project Explorer'', click ''Import...'', and in the dialog box, select ''General'' --> ''Existing Projects into Workspace''. Select the directory you saved the unzipped file into for the root directory, and select all projects there.
    7 }}}
    8 
    9 [[BR]]
    10 {{{
    11 #!div style="border:1pt dotted;color:red"
    12 Note: While the prompts are in beta phase, the starter code is not yet available for some of the prompts.
    137}}}
    148
     
    37314. Allow overflow.
    3832
     33Note that you must use a numeric primitive type, and not a reference type like !BigNumber, and the checksum must consistently fit in 64 bits (size of a {{{long}}}).
     34
    3935=== !MovingAverage
    4036A moving average is the average of the {{{n}}} most recent numbers. Design a data type (see the Internet for a definition) that has the following API that computes the moving average of a set of {{{n}}} numbers stored in the data type:
     
    5450=== !RomanNumeralInterpreter
    5551Write a static method that takes a string input argument (the Roman numerals) and returns the Arabic ("normal") equivalent. Use conventional, contemporary rules for Roman numerals (see [http://en.wikipedia.org/wiki/Roman_numerals wikipedia]).
     52
     53Limit the Roman numeral to a max of 5,000 and throw an {{{java.lang.IllegalArgumentException}}} if the limit is exceeded or the Roman number is invalid.
    5654
    5755=== !QueenCheck