Answer:
#here is code in python.
# read the food bill
tot_bill=float(input("Please enter the food bill:"))
# tax on food
tax=0.06
#choice for tip by user
choice=int(input("enter your choice for tip:(1 for 15%, 2 for 18% and 3 for 20% :)"))
// calculate the total food bill
if choice==1:
tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.15)
elif choice==2:
tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.18)
elif choice==3:
tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.2)
else:
print("invalid choice:")
#print the total food bill
print("total food bill is ",tot_food_bill)
Explanation:
Read the food bill from user and assign it to variable "tot_bill".Initialize the tax=0.06 (i.e. 6%) on the bill.Then ask user to give his choice for tip. if the choice is 1 then tip will be 15%, if 2 then 18% and if choice is 3 Then tip will be 20% of the bill.Calculate the total food bill and assign it to variable "tot_food_bill".
Output:
Please enter the food bill:100
enter your choice for tip:(1 for 15%, 2 for 18% and 3 for 20% :)2
total food bill is 124.0
Outlook is used for mainly emails. It also keeps track of your calendar, has contact and tasks.
Answer:
def recursive_func():
x = input("Are we there yet?")
if x.casefold() == 'Yes'.casefold():
return
else:
recursive_func()
recursive_func()
Explanation:
We define the required function as recursive_func().
The first line takes user input. The user input is stored in variable x.
The next line compares the user input to a string yes. The function executes the else block if the condition isn't met, that is a recursive call is executed.
IF condition returns the function. The string in variable X is compared to a string 'Yes'. the casefold() is a string function that ignores the upper/lower cases when comparing two strings. (This is important because a string 'yes' is not the same yes a string 'Yes' or 'YES'. Two equal strings means their cases and length should match).
Answer:
11011011
00000000
Explanation:
10022011 cant be an answer because bits are composed of 0s and 1s
and 11100 is too small.
Given the way computers go about completing a linear search for an array of numbers, we can confirm that it would take about six steps to complete the search.
<h3>How do computers perform a linear search?</h3>
When given an array of numbers to search through the linear search method, the computer will follow a logical approach. It will begin at the leftmost number, in this case, the number 7, and then compare each number in the array to the number 52, one by one. When the number finally matches the parameter it is searching for, it will return the answer.
Since in this series of numbers, 52 is the fifth number, the computer will go through the 5 initial steps of comparing each number, and then complete the search with the sixth step which would be returning the index of 52.
Therefore, we can confirm that it would take about six steps for the computer to complete the search using a linear search.
To learn more about linear searches visit:
brainly.com/question/15178888?referrer=searchResults