CS 1010 Assignment 8 Clarence Bees work so hard they actually work themselves to death.Clarence is a young bee about to make its first nectar gathering flight to a special clover field.Beeboss...


CS 1010 Assignment 8 Clarence


Bees work so hard they actually work themselves to death.Clarence is a young bee about to make its first nectar gathering flight to a special clover field.Beeboss provides the location of the clover field relative to Clarence's hive, but never navigating anywhere before, Clarence does not know how to navigate from home to this clover field.All the other bees already left the hive and Clarence needs your help finding the clover.Young bees can fly long distances, but need rest stops along the way, unable to fly more than six beeflight units at a time without a rest (a hop).Clarence relies on you to navigate from the beehive to the clover field by repeatedly telling it two travel distances, a West/East travel distance and a North/South travel distance. Given these two distances, Clarence uses beesense to calculate a direction and distance to fly.If the two travel distances you provide generate a flight "hop" greater than six beeflight units (the maximum survivable hop distance), Clarence will die from exhaustion.Clarence continues under your direction until it finds the clover patch or dies.With every "hop" Clarence reports its current location as a West/East, North/South coordinate pair (no parenthesis), or reports "I failed…" and dies, terminating the search for the clover.Once Clarence finds the clover patch, Clarence reports "I found the clover, THANK YOU!" terminating the search. Clarence finds its own way back home.


Name the solution Clarence.


Represent East and North distances traveled (or to travel) using positive integer beeflight units and West and South distances travelled (or to travel) as negative integer beeflight units.Clarence's hive is location 0, 0, the first zero representing the West/East location, the second zero representing the North/South location of the hive.Use variable namesclarenceWestEastandclarenceNorthSouthto contain Clarence's West/East and North/South positions, respectively.The location of the clover field is randomly generated as West/East integer beeflight units between -10 and +10 inclusive, and North/South integer beeflight units between -10 and +10 inclusive.Do this in pseudocode stating cloverWestEast = random integer between -10 and +10 inclusive.Make a similar statement for cloverNorthSouth.Use variables westEast and northSouth to receive the user's input for beeflight units west/east & north/south respectively.


Your IPO and pseudocode must conform to the style and keywords presented in CS 1010 lectures.




Please type all pseudocode language words in all capital letters.Remember to declare and initialize all variables at the beginning of the solution.Variable names must reflect the variable's purpose in the solution and if the name consists of multiple words must be written in camel case.If the variable stores words, initialize the variable to the empty string ('' two apostrophes, not a quote), else initialize the variable to zero or an appropriate starting value.When initializing variables at the solution beginning it is acceptable to place multiple variables containing the same kind of data (in this example, numeric as opposed to string data) on the same line such as:clarenceWestEast = 0, clarenceNorthSouth = 0, westEast = 0, northSouth = 0.InitializeMAX_BEEFLIGHT_UNITSto the maximum beeflight units Clarence can fly in one hop without dying and use this variable after it is initialized (do not use the value) as needed in the remainder of the solution.Initialize all other variables.After all variables are initialized,output the statement "Beeboss commands all bees to fly to the clover field at" and complete this statement with the cloverWestEast value, comma, cloverNorthSouth value, by concatenating (use +) cloverWestEast (not enclosed in apostrophes, it is a variable containing a value and the value needs displayed not the variable name), then concatenate the comma enclosed in apostrophes, then concatenate cloverNorthSouth.While Clarence lives and the clover is not found, Clarencerepeatedlyasks for West/East and North/South values and calculates beeflight travel distance for this hop using the words "square root of" to represent finding the square root of a value, and if the distance to fly in this hop is too far Clarence outputs "I failed…" and the solution exits, otherwise Clarence calculates and outputs "My new position is: ", followed by the newly calculated position.Calculate the new position as a self-modifying statement such as clarenceWestEast = clarenceWestEast + westEast.Do similar for North/South.If Clarence's new position is the clover field, output "I found the clover, THANK YOU" and immediately exit the program, elserepeat.



Note the repetition control used in the above explanation uses priming statements rather than priming inputs because the loop does not repeat based upon user provided sentinel values, it repeats based upon solution calculated sentinel values.Use variables cloverFound and clarenceLivesto control this repetition control structure.



Solution expectations include adhering to the directions provided in the above paragraphs, using efficient selection and repetition control structures, using unambiguous prompts, adhering to suggested variable names (note, your solution might use variables in addition to those named in this document) and no unnecessary statements.Failure to meet these expectations will result in point deductions.



Submit a single Word file named A8_(your computing ID)_(your first name)_(your last name) without the parentheses that containsyour IPO and pseudocode
before 11:55:00 April 8.You must do a desk check of your pseudocode on paper to check that your algorithm is correct, however you do not turn in the desk check.



Submitting this assignment for grading signifies you understand and agree to abide by CS 1010 syllabus topics "Getting Help" and "Honor Policy".

Apr 08, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here