Saturday, 16 September 2023

tip calculator! \\ A simple program for calculation the tip using python

   TIP CALCULATOR


#If the bill was $150.00, split between 5 people, with 12% tip.


#Each person should pay (150.00 / 5) * 1.12 = 33.6

#Format the result to 2 decimal places = 33.60


#Tip: There are 2 ways to round a number. You might have to do some Googling to solve this.💪


#Write your code below this line 👇

print("Welcome to the tip calculator!")

bill=float(input("What was the total bill? $"))

tip_percentage=int(input("How much tip would you like to give? 10, 12, or 15?"))

total_bill=bill*(1+tip_percentage/100)

person=int(input("How many people to split the bill?"))

each=round((total_bill/person),2)

print(f"Each person should pay: ${each}")

Program(python):-Find duplicates in an array (Geeks for geek problem)

QUESTION:- Given an array  a  of size  N  which contains elements from  0  to  N-1 , you need to find all the elements occurring more than o...