List of all available Websheets
Viewing cpp/cs102/practiceBonus/interpolationBonus 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 | <p>Jane is now a sophomore at USC. She continues to believe in the linear relationship between how long she studies for an exam and how well she does. </p> <p>However, she now doesn't want to rewrite her program every time she takes a new class, which will have a new linear relationship. </p> <p>Ask the user to enter two score-hour pairs first. Then, given an exam score between 0% and 100%, estimate how long Jane should study to receive that score. </p> <p>Example: 35 1 86 19 70 would correspond to "Jane studied for 1 hour and got 35%, or 19 hours and got 86%. How long should she study to get a 70%?"</p> <p>Note: Jane has noticed that some classes, no matter how long she studies, it makes <strong>no difference</strong> to her score (i.e. she gets the same percentage). In this case, you should print "not possible"!</p> |
Remarks Comments, history, license, etc. | Copied from problem cpp/cs102/practice5/interpolation (author: jmell@usc.edu) Copied from problem cpp/cs102/practice5/messageDecoder (author: jmell@usc.edu) Copied from problem cpp/cs102/practice5/computingPie (author: jmell@usc.edu) |
Engine | |
Template / Reference solution |
using namespace std; int main() { int targetPercent, hour1, hour2, percent1, percent2; \[ REDACTED ]\ 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":"86 7 77 6 95", "args":[]}, {"stdin":"35 1 86 19 70", "args":[]}, {"stdin":"35 1 86 19 86", "args":[]}, {"stdin":"73 6 73 15 70", "args":[]} ] |
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'.