Task 1 Task 2 Task 3
Task 1 Task 2 Task 3

Task 1

You have been hired by a popular restaurant chain to create a tip calculator program.

The program should allow the restaurant's customers to calculate the amount of tip to leave based on their bill amount and preferred tip percentage.

Requirements:

  1. Ask the user to enter the total bill amount.
  2. Ask the user to enter the tip percentage they would like to leave (e.g., 10, 15, 20).
  3. If valid inputs are provided, calculate and display the tip amount and the total amount (bill + tip)

Exception handling

Allow the user to repeat the calculation or exit the program.

.

Write this program.

Task 2

A computer program asks a user to enter 5 whole numbers. It then calculates the total of the 5 numbers and displays the result.

For example:

Input a number: 2

Input a number: 4

Input a number: 2

Input a number: 4

Input a number: 2

The total number is 2.8

Write this program. Make sure you handle possible exceptions.

Task 3

This formula is used to convert a temperature given in degrees Celsius to degrees Farenheit:

Write a computer program that asks the user for a temperature in Celcius and stores and displays the equivalent temperature in Farenheit. Handle any predictable exceptions.

Challenge 2: could you rearrange the formula and create a program to ask for a temperature in Farenheit and display the equivalent temperature in celcius.

Random Name

Task 4

10 cookies can be made with the following ingredients.

  1. 2 cups of sugar
  2. 5 cups of flour
  3. 1 cup of chocolate chips

Write a program that will ask the user how many cookies need to be made and the program will display how many cups of sugar, flour and chocolate chips ar required. Write code to handle any anticipated exceptions.