Question
2,Write a function that takes as two parameters: the zone and the ticket type, and returns the Copenhagen Transit fare.
If the zone is 2 or smaller and the ticket type is "adult," the fare is 23.
If the zone is 2 or smaller and the ticket type is "child," the fare is 11.5.
If the zone is 3 and the ticket type is "adult," the fare is 34.5.
If the zone is 3 or 4 and the ticket type is "child," the fare is 23.
If the zone is 4 and the ticket type is "adult," the fare is 46.
If the zone is greater than 4, return a negative number (since your calculator does not handle inputs that high).
3,Write a program that allows the user to choose which currency they would like to convert. Using the chart from #5, choose the currencies that begin with the first five unique letters of your name. You should print out the currencies your program will convert, ask the user for their currency choice, and then amount of money to be converted. Your program should then print the amount of money in the chosen currency. For example:
Sameh's Currency Converter
Converts from dollars into Somali Shilling, Afghan Afghanis, Moroccan Dirhams,
Euros, and Hungarian Forints.
Choose a currency ('S', 'A', 'M', 'E', 'H'): h
What amount: 1000
The chosen currency is: Hungarian Forints
The converted amount is: 4.56
4,Write a program that asks a user to enter a list of clothing items purchased. Your program should then calculate their total bill with tax. In New York City, the tax on clothing items that priced $110 or less is 0%. The tax on clothing items priced more than $110 is 8.5%.
Here is a sample run of the program:
Please enter clothing prices, separated by commas: 100, 9.99, 200, 159.99
Your receipt:
100.00
9.99
200.00 T
159.99 T
---------
500.58
5,Write a program that asks the user to enter a number between -10 and 10. If they enter a number out of range, print a message that the number is out of range and prompt them again for a number between 1900 and 2012. When the user enters a number in range, print the number to the screen and end the program.
6, Write a guessing word program. First, pick a word, name, or phrase for the user to guess,
While the user has not guessed the word, print out two messages: one that says whether the message that was entered is too short, just right, or too long. Your second message should tell the user if there guess was before or after in the ordering of strings. Your game should continue until they guess your secret string and then should print a message congratulating them.
7.Write a program that asks the users to enter a sequence of amounts to credit or debit to their account. Your program should continue to process their amounts as long as their balance is positive. If at any point they have a negative balance, print a message and end the program. If you are able to process all the amounts, print the final balance to the screen before ending the program. You may assume that their beginning balance is $1000.
One sample run of the program:
Please enter the amounts to credit/debit from your account, separated by commas:
-500,100.01,-1000,333.33,85.02,-200
Beginning Balance: $1000.00
Amount: -500
Balance: $500.00
Amount: 100.01
Balance: $600.01
Amount: -1000
Your balance has dropped below 0! Please contact the bank immediately!
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
#This program converts currencies using L, I, Y, K, A as the currency codes from#chart 5. It will keep running if an incorrect currency code is entered, but
#it will quit if an incorrect number is entered. Also this program rounds the
#value to 2 decimal places
exchanged = 0
while(exchanged == 0):
print("What currency would you like to convert from US dollars to?")
print("Lebanese Pound (LPP)")
print("Indonesian Rupiah (IDR)")
print("Yemeni Rial (YER)")
print("Kenyan Shilling(KES)")
print("Afghan Afghani (AFN)")...