Question: You will be writing a program that has 3 different functions in it . First, define all 3 functions. Define a function that performs a
You will be writing a program that has different functions in it
First, define all functions.
Define a function that performs a mathematical square. It accepts one parameter, which is the number to be squared. The function should have a print statement that prints out the number that was passed in as an argument. Then it should perform the square. Then it should print out the resulting square.
Define a function that repeats a string times. It accepts one parameter, which is the string to be repeated. The function should print that statement times.
Define a function that prints the amount you should tip a waiter. It accepts two parameters: the amount of the meal, and the percentage you want to tip. The function should print both the amount of the tip itself, and the full amount of the meal, including the tip.
Next, you should call all three of your functions.
Call your squaring function times with different arguments
Call your string repeating function times with different arguments
Call your tip calculator function times with different sets of arguments
Your program should meet the following requirements:
Use comments as necessary to communicate to me the reader of the program
Use a consistent naming convention for your variables preferably using underscores
Use a consistent indentation format tabs vs spaces
Use meaningful variable names
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
