Tip to leave at a restaurant after a meal

Assignment Help Basic Computer Science
Reference no: EM131716452

Can you explain to me the layout as to how to write a function?

In this problem: This purpose of this program is to compute the amount of a tip to leave at a restaurant after a meal. The program asks the user for the amount on the bill and the number of diners at the table.If the number of diners is six or more, the default tip percentage will be 18%. If the number of diners is less than six, the program will ask the user for the desired tip percentage. The program then prints the original amount of the bill, the calculated tip amount, and the total amount. You may assume that all user inputs are valid. You do not have to worry about printing only two digits after a decimal point. You do not have to comment your program.

I know I begin with def whatToPay():

However, I don't understand how I should write the rest. The function would be amount = bill * tip. How should I define my parameters? Or even, what are my parameters? Is it bill, tip, and diners? I am completely lost.

Reference no: EM131716452

Questions Cloud

Which compound is being oxidized : In the redox reaction depicted in Figure, which compound is being oxidized, and how did you determine this
Except february which has twenty-eight : The following rhyme helps us remember how many days there are in any given month:
Describe any characteristics that you would need to develop : Describe any characteristics that you would need to develop in working on this case and why this would be important.
What other influences are present in their approach : Several countries does not offer free schooling to children. For example, most schools in the Philippines does not receive any government funds.
Tip to leave at a restaurant after a meal : In this problem: This purpose of this program is to compute the amount of a tip to leave at a restaurant after a meal. The program asks the user
Explain why the members of the group : Explain why the members of the group you choose is at risk for TBI
Describing test cases based on ontologies : Describing test cases based on ontologies - Test case abstraction after execution - Test case reuse models and frameworks
Examine the actions you will take to address : Identify the main resources that you will need in each of the following areas in order to implement the plan - economic, social / community, political.
Discuss some experiences of the later years : Discuss some experiences of the later years that may alter an older person's self-concept and may negatively influence their self-esteem

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What other motivations may prompt such alliances

Discuss the reasons that companies embark on cross-border strate- gic alliances. What other motivations may prompt such alliances?

  Design the program to operate the car wash

Using whatever PLC sequencer output instruction you are most familiar with, develop a program to implement an automatic car-wash process.

  Each letter of a three-letter word stored in memory

Write an LC3 program that "increments" each letter of a three-letter word stored in memory following the program. 'a' becomes 'd', 'n' becomes 'q', 'z' becomes 'c', etc. Make sure you comment your code! This is the Julius Caesar Cipher. Assume that a..

  Draw the cam arm, using the given dimensions

(Figure 8.158) Draw the cam arm, using the given dimensions and calculating the missing ones. The curve is made of fi ve tangent circular arcs. The rise is the change in distance from the center of the hole in the cam arm.

  Assignment on corporate responsibility and marketing

Use the Internet to research the Apple Corporation, its current position and reputation regarding ethical and social responsibility, and the strategies that it currently employs to market its products.

  What other strategies can you think of

What other strategies can you think of? How do they compare to the two studied in the previous programming problem?

  Designing an active directory infrastructure

What are some factors or requirements when designing an Active Directory Infrastructure? How do you gather the requirements for the design? Please explain in approximately in two paragraphs.

  Good relationship names and relationships types

Design and draw an ERD with entity types customer, employee, payment, account, vehicle and expense. use your own discretion and knowledge in database to connect them with good relationship names and relationships types.

  Understanding linux system initialization and x windows

In Linux, a boot loader can locate and execute the kernel of the operating system, as well as performing other functions.

  Examine the time variable in the offline data

Try controlling for other variables that might affect this relationship.

  Determine the probability of these events

Draw a Venn diagram to illustrate the event of selecting an ace or a diamond from a deck of cards.

  What does get node before return if the sorted list is empty

How can you use this fact to simplify the implementation of the method insert Sorted given previously?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd