subject

I need the following code commented and addressed: Specifically, your script should address the following critical elements:I. In Your Script (Annotated Text File) Refer to the directions in the module in Codio for how to export out and comment your completed script. A. Identify examples of custom functions in your script using comments in your code. B. Identify examples of input (parameters) that are utilized within the function(s) in your script using comments in your code. C. Identify examples of functions that return the correct output in your script using comments in your code. Applying Your Experience Making mistakes when you learn to write code is common. It is part of learning. What is important is developing the skill of learning how to understand your errors and then fix them (debugging). For this part of your final project, you will respond to the following: A. Reflecting on your experience with this activity, explain the importance of knowing how and when to use and modify custom functions, inputs (parameters) within functions, and functions to return the correct output. Support your response with examples from the activity of the types of errors and your method for fixing them. Thanksimport sys# account balanceaccount_balance = float(500.25)#PPrint the balancedef printbalance(): print("Your current balance : %2f" % account_balance)#the function for depositdef deposit(): deposit_amount = float(input("Enter amount to deposit : ")) balance = account_balance + deposit_amount print("Deposit was $%2f, current balance is $%2f" %(deposit_amount, balance))#function for withdrawdef withdraw(): withdraw_amount = float(input("Enter amount to withdraw")) if(withdraw_amount > account_balance): print("$%2f is greater than account balance $%2f\n" %(withdraw_amount, account_balance)) else: balance = account_balance - withdraw_amount print("$%2f was withdrawn, current balance is $%2f" % (withdraw_amount, balance))# User Input goes here, use if/else conditional statement to call function based on user inputuserchoice = input("What would you like to do?\n")if (userchoice == 'D'): deposit()elif userchoice == 'W': withdraw()elif userchoice == 'B': printbalance()else: sys. exit()

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:00, starwarsfan1975
Meenu wants to create a high quality drawing in a variety of colours. which device should she use for the same?
Answers: 1
image
Computers and Technology, 22.06.2019 21:00, jarrettashlyn
Write a method so that the main() code below can be replaced by the simpler code that calls method original main(): public class calcmiles { public static void main(string [] args) { double milesperhour; double minutestraveled; double hourstraveled; double milestraveled; milesprhour = scnr. nextdouble(); minutestraveled = scnr. nextdouble(); hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; system. out. println("miles: " + milestraveled); } }
Answers: 2
image
Computers and Technology, 23.06.2019 02:00, eila3601
As with any small island country, cuba has fewer natural resources than countries such as brazil. this affects their economy in that cuba a) exports only manufactured products. b) exports more products than it imports.. c) must import more products than it exports. d) has imposed trade barriers against the united states.
Answers: 3
image
Computers and Technology, 24.06.2019 08:30, colebuug9
Aconsumer would pay an extra they used the rent to own program to buy the computer, rather than using cash. for all of the items, is the cheapest option over the life of the contract. the most expensive overall option is to use purchase the item.
Answers: 2
You know the right answer?
I need the following code commented and addressed: Specifically, your script should address the foll...

Questions in other subjects:

Konu
Health, 16.07.2021 15:30