Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Below is a program that uses a fuction to compute the cost of hiring an attorney from Wright & Co.law office,which is priced in dollars

Below is a program that uses a fuction to compute the cost of hiring an attorney from Wright & Co.law office,which is priced in dollars

image text in transcribed

Answer the following questions. Refer to line numbers if you find it helpful in your answers.

(a) Listallofthefunctionargumentsinthisprogram.

(b) Listall ofthe function parameters in this program.

(c) Listallofthevariablesthatarenotarguments orparameters.

(d) What is the scope of: i. number_of_trial_days ii. total_cost iii. cost1

(e) How many function definitions are in this program?

(f) How many function calls are in this program?

(g) Whatarethe valuesreferredtobycost1andcost2when the programends?

1 def cost-of-attorney number-of-trial-days price-per-day number-of-witnesses, price-per-witness) Computes the cost of an attorney which is in dollars number-of-trial days the number of days the trial lasts price-per-day cost of an attorney working for 1 day in dollars number of witnesses how many witnesses need to be CrOSS examined during the trial price-per-witness price of an attorney per witness that needs to be cross examined in dollars Returns total cost of an attorney 14 15 total-cost-per-day number-of-trial days price-per-day 16 total witness-cost number-of-witnesses price-per-witness 17 total-cost total cost-per-day total-witness-cost return total cost 20 compute the cost of a trial that lasts 2 days, 21 each day costs 600$, there are 3 witnesses, and it costs 100$ per witness 22 cost 1 cost-of-attorney (2 600 3, 100 24 compute the cost of a trial that lasts 9 days 25 each day costs 400$, there are 13 witnesses, and it costs 100$ per witness 26 cost cost-of-attorney (9 400 13 100)

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_2

Step: 3

blur-text-image_3

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

Students also viewed these Databases questions