GE1501 C++: A World Without Lemons

Summary:

The world is running out of lemons and we have discovered an ancient code to make the ritual circle. In order to decipher the code, we must find the solutions to the problems below. Each problem will give you a coordinate to make the ritual drawing. You must get 5 problems correct to unlock enough coordinates to complete the ritual. Draw the final shape in AutoCAD and then unlock the box at the front of the room!

Skills to be Obtained:

  • Use your mastery of C++ to solve the following problems
  • Implement Loops, Branching, Functions, and C++ fundamentals
  • Use AutoCAD and logic to solve the bigger puzzle

Details:

Please work with up to one partner on this assignment. To win the game and earn full credit, you have to determine the ritual drawing which leads you to the secret 3-digit code to open the box at the front of the class (solve 5 out of 8 problems below). The ritual drawing is hidden using a cryptographically strong mechanism known as Secret Sharing. The technique allows a secret to be distributed among many people such that none of them have any idea what the secret is until more than one of them come together with their share of information.

Background:

Secret Sharing: A cryptographically weak way to share the code word “secret” among two people is to give the first person “sec---“ and the second person “---ret”. If they come together, they can recreate the whole word. This simple secret sharing technique is very weak, since both people already know half of the secret even before getting together with the other partner. In fact, either person probably could have guessed the code word without too much difficulty.

In Secret Sharing, the secret remains completely hidden from everyone until the required number of people assemble. But, as soon as the required number of people each give their share of information, the secret becomes fully revealed. It is also very flexible, in that you can choose how many people have to assemble to revel the secret. In fact, you can give shares of the secret to as many people as you like, and still no one will have any idea what the secret is until the right number of them assemble and provide their shares. For example, you could give a share of the secret to 8 people, requiring any 4 of them to contribute the data they were given in order to determine the secret.

Assignment:

In today’s game, the launch code has been “shared” among eight people. We’ve given 1 share to each of the following; old wizard, hungry dragon, pondering ogre, thieving kender (hobbit with a stealing problem), patrolling gargoyle, bloodthirsty princess, devious lich, and forgetful scribe. Only when at least 5 of these 8 people agree to give you their share of the secret can you solve the problem.

You and your partner need to obtain 5 shares of the secret and connect them to make a drawing with AutoCAD, (i.e., 5 Cartesian (x, y) points) and then determine the corresponding 3-digit lock code. Obtaining a share of the secret is accomplished by solving 1 of the problems listed on the next page. Show me a solution to 1 of the problems, and I’ll give you that person’s share of the secret. Keep that information secure!

For each problem you wish to solve, write a C++ code that answers the questions or a list of the errors (for the scribe). You may use class notes or Canvas to help, but you may not use Google or other Internet resources. As soon as you have 5 shares of the secret, you can determine the ritual drawing and then the 3-digit code and you have won the game.

Submission Requirements:

After obtaining 5 shares of the secret, show them to me and let me see it run.

Extended Work:

If you wish, you can continue and solve all eight of the problems listed on the next page by the end of class. There is no partial credit for this option. To obtain extra credit, obtain all eight shares of the secret by solving each of the problems and then draw the ritual in AutoCAD.

Problems:

Each of the eight people listed below have been given one (x, y) point. Show me a script that solves the problem and outputs the correct answer, and I’ll give you that person’s point.

Old Wizard: I cannot remember my basic math. What is the sum of all numbers between 0 and 500 not divisible by 2? Remind me and I will reward you with a coordinate.

Pondering Ogre: I have been pondering perfect squares as of late, but I can only count up to 500. What is the biggest perfect square that I can count up to? (hint: if the number is below 60, you are giving me the square root of the number, no the perfect square itself!)

Thieving Kender: I have recently stolen two wonderful functions to make my brand new flag! Please write me a program that uses my functions to output the following flag (copying “” with CLion work poorly. I suggest retyping them.):

void star (int i)
{    for (int j = 0; j

        cout<<"*";  }

void space (int i)
{   for (int j = 0; j

        cout<<" ";  }

你可能感兴趣的:(c#,开发语言)