Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The first parameter represents a direction ( the value of one of the constants UP , DOWN, FORWARD and BACKWARD ) and the second represents
The first parameter represents a direction the value of one of the constants UP DOWN, FORWARD and BACKWARD and the second represents the number of words left to be found before this guess. Return the points that would be earned if we were to now find some word in this direction.
If there are THRESHOLD or more words left to be found, the number of points for a correct guess is simply THRESHOLD times the factor for the appropriate direction. If the number of words left to be found is less than THRESHOLD, then the total points earned for a correct guess is two times THRESHOLD minus the number of left to be found before the guess, all multiplied by the factor for the appropriate direction. On top of that there is an extra bonus of BONUS points for finding the last word.
For example, suppose there are five words left to be found, and we correctly guess a backward word. Then the number of points for the correct guess is:
THRESHOLD BACKWARDFACTOR
If there were only two words left to be found, and we correctly guess a backward word, then the number of points for the correct guess is:
THRESHOLD BACKWARDFACTOR points.
If there was only one word left to be found, and we correctly guess a backward word, then the number of points for the correct guess is:
THRESHOLD BACKWARDFACTOR BONUS points.
getpointsstr int int
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started