1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
olga_2 [115]
3 years ago
14

Write a split check function that returns the amount that each diner must pay to cover the cost of the meal The function has 4 p

arameters:
1. bill: The amount of the bill,
2. people. The number of diners to split the bill between
3. tax_percentage: The extra tax percentage to add to the bill.
4. tip_percentage: The extra tip percentage to add to the bill.
The tax or tip percentages are optional and may not be given when caling split_check. Use default parameter values of 0.15 (15%) for tip percentage, and 0.09 (9%) for tax_percentage
Sample output with inputs: 252
Cost per diner: 15.5
Sample output with inputs: 100 2 0.075 0.20
Cost per diner: 63.75
1 # FIXME: write the split.check function: HINT: Calculate the amount of tip and tax,
2 # add to the bill total, then divide by the number of diners
3.
4. Your solution goes here
5.
6. bill - float(input)
7. people intinout)
8.
9. Cost per diner at the default tax and tip percentages
10. print('Cost per diner: split_check(bill, people))
11.
12. bill - float(input)
13. people int(input)
14. newtax_percentage - float(input)
15. nen_tip percentage float(input)
16.
17. Oust per dinero different tox and tip percentage
18. print('Cost per diner: split checkbull people, new tax percentage, new tip percentage)
Computers and Technology
1 answer:
Trava [24]3 years ago
7 0

Answer:

def split_check(bill, people, tax_percentage = 0.09, tip_percentage = 0.15):

   tip = bill * tip_percentage

   tax = bill * tax_percentage

   total = bill + tip + tax

   

   return total / people

bill = float(input())

people = int(input())

print("Cost per diner: " + str(split_check(bill, people)))

bill = float(input())

people = int(input())

new_tax_percentage = float(input())

new_tip_percentage = float(input())

print("Cost per diner: " + str(split_check(bill, people, new_tax_percentage, new_tip_percentage)))

Explanation:

Create a function called split_check that takes four parameters, bill, people, tax_percentage and tip_percentage (last two parameters are optional)

Inside the function, calculate the tip and tax using the percentages. Calculate the total by adding bill, tip and tax. Then, return the result of total divided by the number of people, corresponds to the cost per person.

For the first call of the function, get the bill and people from the user and use the default parameters for the tip_percentage and tax_percentage. Print the result.

For the second call of the function, get the bill, people, new_tip_percentage and new_tax_percentage from the user. Print the result.

You might be interested in
Select the correct answer.
enot [183]

Answer:

B.24

#carryonlearning

Explanation:

hope it can help

7 0
2 years ago
Which is the term for a computer typically located in an area with limited security and loaded with software and data files that
otez555 [7]
Sorry..................
8 0
3 years ago
Where should you endorse a check
yKpoI14uk [10]
This is done by signing your name on the back of the left end of thecheck<span>. </span>You<span> can also limit who can cash it by specifying in your </span>endorsement<span> that it is only to be deposited into your specified account at Provident.</span>
5 0
3 years ago
Read 2 more answers
1. The primary purpose of the human resource department in any company is to (1 point) A.) promote policies in the best interest
antoniya [11.8K]

Answer:

A.) promote policies in the best interest of both employees and the organization

Explanation:

The primary purpose of Human Resource Department in any organization is to promote policies in the best interest of both employees and the organization. They are like the heart of the company because they also deals with the staffing, compensation, retention, training, and employment of law and policies side of the business. The human resource department apart from writing of policies and procedures for hiring staffs also have plans in place to ensure that the right people that fits the job description and experience needed for a role are hired and trained for the job.

8 0
3 years ago
A binary search algorithm is written (as in the modules, for example) which searches a pre-sorted array for some user-defined va
Mazyrski [523]

Answer:

c) it will always return with an answer of 7 or fewer comparisons of data.

Explanation:

As maximum number of comparison in worst case for sorted binary search is log₂n, here n = 100, so maximum search is at least 6.6 which is approximately 7.

4 0
3 years ago
Other questions:
  • Image files are grouped into two categories: _____.
    5·1 answer
  • Atoms may be bonded together by losing, gaining or sharing _____________.
    7·1 answer
  • If the wrong server edition is installed, what command can be used to change to a different edition?​
    5·1 answer
  • TCO 10) Voice packets could experience a significant _____ delay in routers and switches when sharing a network with data traffi
    15·1 answer
  • Describe IT infrastructure. What is the role of business intelligence in determining the technology needs of a business?
    11·1 answer
  • The _________ indicates the number of elements, or values, an array can hold
    14·1 answer
  • In the single-site processing, single-site data (SPSD) scenario, all processing must be done on the end user's side of the syste
    10·2 answers
  • To make an exact copy of an existing slide, from the new slide gallery
    5·1 answer
  • Please help it would mean to world to me❤️ (WORD)
    13·1 answer
  • def multiplication_table(number): # Initialize the starting point of the multiplication table multiplier = 1 # Only want to loop
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!