a) Basic Calculator Task: Create a simple calculator that performs all arithmetic operations. Steps: - Use functions to perform each arithmetic operation. - Use a while loop to continuously prompt the user for actions (choose operation, input numbers, display result, exit). - Use arithmetic operators to perform calculations. - Use conditional statements to handle different user inputs and errors.
Example interaction: 1. Choose operation (addition) 2. Input numbers (3, 5) 3. Display result 4. Exit Expected output: Result of the arithmetic operation.
b) Temperature Conversion Tool
Task: Write a program to convert temperatures between Celsius and Fahrenheit. Users should be able to input a temperature and choose the conversion type. Steps: - Use functions to convert Celsius to Fahrenheit and vice versa. - Use a while loop to continuously prompt the user for actions (input temperature, choose conversion, display result, exit). - Use arithmetic operators for the conversion calculations. - Use conditional statements to handle different user inputs and errors. Example interaction: 1. Input temperature (100) 2. Choose conversion (Celsius to Fahrenheit) 3. Display result 4. Exit Expected output: Converted temperature