Hello, iam new to programming, and ive been given a task in my Uni to complete certain exercises but i found it very difficulty to solve them. I was wandering if there is someone who can help me solve this problems. I cant tell u how much i will be gratefull if someone can help me. Please if anyone knows how to solve certain task reply to me.Thanks to all in advance.
Tasks
1. Your are going to a restaurant where the tip is expected to be 15% of the total bill. Write a function that will calculate the tip and the total amount payable, given the bill amount. The output of your program should be formatted so that the amounts are preceded by a $ and are rounded to 2 decimal places. They should be printed as below.
For example if the function was called with the value of $100, the output should be:
Bill: $100.00
Tip: $ 15.00
Total Amount $115.00
2. The price of a car consists of its base price and a number of charges. Some are percentages of the base price, others are a flat rate. Using the table below, write a function that calculates the total price of a car when given the base price. The function should print out a summary of all the charges and the total price
Sales tax 10%
Commission 5%
Dealer Fee 15%
Licence Fee $100.00
Detailing $150.00
Roadworthy $ 50.00
Sample output:
================================
Base Price $ 10000.00
Tax $ 1000.00
Commission $ 500.00
Deale $ 1500.00
Licence $ 100.00
Detailing $ 150.00
Roadworthy $ 50.00
===============================
Total Cost $ 13300.00
3. Write a function that simulates a fortune cookie. The program should display one of at least five unique fortunes at random each time it is run.
4. Write a function that plays the “Guess My Number”. It should randomly select a number between 1 and 100 and invite the user to guess the number. The program should allow the user 7 guesses, and tell the user if the number is higher or lower than their guess. If the user guesses the number the game should print a congratulatory message and terminate. If the user cannot guess the number, then the game should print a message to this effect, tell the user what the number was, and terminate
5. Write a function that jumbles a word and then asks the user to guess the word. The function should have a list of words it can pick randomly from. It should then jumble that word, print the jumbled word and ask the use to guess the correct word. The program should keep asking the user to guess until they either enter the correct word, or press return with no guess entered. The program should either print a message congratulating the user on guessing the correct word, or commiserating and giving them the correct word.
An example of the output could be:
eyas
Guess the word (return to quit): yese
Sorry, that's not it
Your guess(return to quit): yeas
Sorry, that's not it
Your guess(return to quit): easy
CONGRATULATIONS! You guess it!
Thanks for playing
Or
rsnwae
Guess the word (return to quit): runaway
Sorry, that's not it
Your guess(return to quit):
Bad luck, the word you were looking for is 'answer'
Thanks for playing
6. Write a program that creates a menu. The program should give the user a list of numbered options, and accept a number as the user’s choice. The program should run until the user chooses the exit number. Incorporate all the functions you have written above into the menu program so that the user can choose to run them using the menu. The program should give the user an error message if they choose an incorrect number.
The menu program should prompt the user for the input required for any function that requires input and pass that input into the functions.
Sample output
=============================
********* MENU **************
1 Tipping Calculation
2 Car Price Calculation
3 Fortune Cookie
4 Guess My Number Game
5 Word Jumble Game
6 Exit Program
What would you like to do: 8
Incorrect choice, try again
=============================
********* MENU **************
1 Tipping Calculation
2 Car Price Calculation
3 Fortune Cookie
4 Guess My Number Game
5 Word Jumble Game
6 Exit Program
What would you like to do: 6
Thank you for using this program
Bye Bye!