Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

whats wrong with this code ( def main ( ) : # Prompt the user for input num _ pirates = int ( input (

whats wrong with this code (def main(): # Prompt the user for input num_pirates = int(input("How many pirates: ")) num_units = float(input("How many units: ")) # Step 1: Calculate Yondu's share yondu_share = num_units *0.13 # Step 2: Calculate the remaining units after Yondu's share and then Peter's share remaining_units = num_units - yondu_share -3* num_pirates # Subtracting 3 units per pirate peter_share = remaining_units *0.11 # Step 3: Calculate the crew's share per person total_share = remaining_units + yondu_share + peter_share +3* num_pirates # Adding 3 units per pirate back crew_share_per_person = total_share / num_pirates # Yondu, Peter, and Crew's share rounded to 2 decimal places yondu_share_rounded = round(yondu_share, 2) peter_share_rounded = round(peter_share, 2) crew_share_rounded = round(crew_share_per_person, 2) # Print

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

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions