Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language: Python Program used: PyCharm Interpreter: 3.6.1 at ~/anaconda/bin/python Question 6 (7 points): Purpose: To practice the use of arithmetic Degree of Difficulty: Moderate The

Language: Python

Program used: PyCharm

Interpreter: 3.6.1 at ~/anaconda/bin/python

image text in transcribed

Question 6 (7 points): Purpose: To practice the use of arithmetic Degree of Difficulty: Moderate The notorious pirate. Tractor Jack, has spent the summer sailing up and down the Saskatchewan River. raiding silos, and stealing tons of wheat, barley and other grains. With winter coming. it's time for Tractor Jack to divide up this booty amongst his crew. The accord Tractor Jack has with his crew is that, as captain, he receives 30% of all the booty. The rest is to be divided up amongst his crew in equal shares. Finally. Jack, being a socially responsible pirate to the Saskatoon Food Bank ly donates $500 plus 2% of his own share of the booty Write a program for Tractor Jack that will ask the user to input the total value of booty plundered (in dollars) and the number of crew (not including Tractor Jack himsel. Then the program should display the value of Tractor Jack's share of the booty (before his charitable donation), the value of the remaining share to be divided amongst the crew, the value of booty that each crew member receives, and the amount of money Jack donates to the food bank You may assume that the user supplies valid input from the console, that is, a positive number for the amount of plunder, and a positive number for the number of crew. Sample Run If completed correctly. your program's console output should look something like this. As usual green text shows the text entered by the user, and blue text highlights the values calculated by the program. Enter the total value of wheat, barley and other grains plundered in dollars: 9000 Enter the number of crew: 17 Tractor Jack's 30% share of the booty is orth: $2700.0 Crew's 70% share of the booty is worth: $6300.0 Each cre member takes home: $370.5882352941176 Jack donates $554.0 to the Saskatoon Food Bank. Notice that the user is not expected to type the $ when entering the value of the wheat, barley. and all the other grains. It is also not a concern if your displayed dollar amounts have more or less than two digits after the decimal place, or don't have a decimal at all You will not be penalized for this (unless the values computed are incorrect). If you are having trouble getting the dollar amounts to print right next to the dollar signs without a space in between, think about how you might use the string concatenation operator (the very end of textbook Section 2.3.4Operators on Strings.) to achieve the desired output. For more about the exciting adventures of Tractor Jack, click here. What to Hand In Hand in your solution in a file called aiq6.py Evaluation . 1 mark for reading in the total plunder and number of crew from the console: . 4 marks for displaying the correct dollar amounts (1 mark each 1 mark for formatting the dollar amounts without a space between the dollar sign and the amount: 1 mark for choosing appropriate variable names (variable names should be descriptive of the data referred to by the variable: single-letters and abbreviations should be avoided)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 1 Lnai 9284

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Carlos Soares ,Joao Gama ,Alipio Jorge

1st Edition

3319235273, 978-3319235271

More Books

Students also viewed these Databases questions