View on GitHub

Yondu-Udonta

CS-1400 Project 1

Project 1: Yondu Udonta

Yondu

Problem Statement

Yondu Udonta and his crew of space pirates arrive at the Iron Lotus after several weeks of plundering the high seas. Since the crew has been in space for nearly six months, they are ready for a night of celebration. Yondu doesn’t want to divvy up the plunder just yet, so he gives each crew member other than himself and Peter Quill 3 units and sends them off to the Iron Lotus. (We’re keeping the units simple for purposes of the problem, even though 1 unit is about $2.33.)

After the crew has gone, he and Peter count what’s left and decide how to split it up among the crew. Yondu takes 13% plunder, which he transfers to a hidden bank account. Yondu gives Peter 11% of the remaining units, which Peter transfers to his account. The next morning, the remaining units are divided evenly among all of the crew, including Yondu and Quill. Little do they know that Yondu and Quill have already taken a cut. If the remaining treasure can’t be split evenly, the units left over are given to the Reaver’s Benevolent Fund (RBF).

Directions

  1. Develop your algorithm in detail before writing any code. Read the problem statement very closely several times to make sure you understand all the small details.

  2. Accept the assignment in GitHub by opening the Assignment Invitation URL link provided in your Canvas assignment.
    • This video provides step-by-step directions for completing GitHub assignments.
  3. From inside your GitHub repository, click the Work in Repl.it button.
  4. Open the exercise.py file in the src directory, and begin coding your solution.

  5. Update the module docstring with your information.

  6. Test your program by running it several times with different input. Verify your algorithm is correct by checking the program output:
User input:
Reavers
User Input:
Units
Program Output:
20 1000 Yondu’s share: 158
Peter’s share: 126
Crew: 36
RBF: 14
Anything other than a positive integer   Enter only positive integers for reavers and units.
  Anything other than a positive integer Enter only positive integers for reavers and units.
less than three   Not enough crew.
  Less than or equal to 3 times the number of reavers Not enough units.
  1. Format the user prompt and output exactly as shown in the example below:

     How many Reavers: 
     20
     How many units:
     1000
     Yondu's share: 158
     Peter's share: 126
     Crew: 36
     RBF: 14
    
  2. Click the Version Control icon in the left menu, type a memo in the What did you change text box, then click Commit & push

  3. Navigate back to your GitHub repository, open the Actions tab, and check your program for accuracy.

    • A green icon indicates your code passed all test cases. Congratulations!
    • A red icon indicates your code needs to be revised and resubmitted.

Helpful Resource(s)