0% found this document useful (0 votes)
4 views

Assignment - 1

Uploaded by

knights09876543
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Assignment - 1

Uploaded by

knights09876543
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment - 1

There are 2 questions for this assignment


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

You might also like